NZTA\OktaAPI\Services\OktaService
A service class used to interact with the Okta API via an {@link OktaGateway} dependency. This class is used to format the data back into SilverStripe objects that can be used to loop through in a SilverStripe fashion.
Synopsis
class OktaService
{
- // members
- private static integer $users_cache_lifetime = 86400;
- private static integer $groups_cache_lifetime = 86400;
- private static integer $group_users_cache_lifetime = 86400;
- private static string $member_unique_identifier = 'Email';
- public OktaGateway $OktaGateway;
- private static array $dependencies = ;
- // methods
- public array getAllUsers()
- public array getUsers()
- public array getAllGroups()
- public array getGroups()
- public array getAllUsersFromGroup()
- public array getUsersFromGroup()
- private string|null getAfterFromLinkHeader()
Members
private
- $dependencies — array
- $group_users_cache_lifetime
—
integer
The lifetime of the cache for the getUsersFromGroup call, in seconds. - $groups_cache_lifetime
—
integer
The lifetime of the cache for the getAllGroups call, in seconds. - $member_unique_identifier
—
string
This defines which DB field uniquely identifies an Okta member so when the sync queued job is run, we can determine if they already exist or not. - $users_cache_lifetime
—
integer
The lifetime of the cache for the getUsers call, in seconds.
public
- $OktaGateway — NZTA\OktaAPI\Gateway\OktaGateway
Methods
private
- getAfterFromLinkHeader() — Helper method to check if there is a "next" link provided from an API response in the "Link" header. If found, return the "after" parameter so that we can set the offset in a subsequent call if required.
public
- getAllGroups() — Get all the groups from the Okta Group API, setting a limit per "page" of results returned.
- getAllUsers() — Get the full list of users, with the help of the getUsers method.
- getAllUsersFromGroup() — Get the full list of users for this $groupID group, with the help of the getUsersFromGroup method.
- getGroups() — Get a "page" of groups from the Okta Groups API, using the after GET parameter.
- getUsers() — Get a subset list of users, starting from a particular cursor point if necessary. This will return both the response headers and contents from the request.
- getUsersFromGroup() — Get a subset list of users for this $groupID group, starting from a particular cursor point if necessary. This will return both the response headers and contents from the request.