NSWDPC\Authentication\Okta\Tests\OAuthTest
Run test related to the Okta API using `okta/sdk`
Synopsis
class OAuthTest
extends SapphireTest
{
- // members
- protected boolean $usesDatabase = true;
- protected boolean $autoFollowRedirection = false;
- // methods
- public void setUp()
- protected void getAccessToken()
- protected void getIssuer()
- public void testOktaAuthenticateUrl()
- protected void getCorrectUser()
- protected void getConflictingUser()
- protected void getAssignGroupTestUser()
- protected void getAssignNoGroupTestUser()
- protected void setSessionOnController()
- protected void setupForLoginHandler()
- public void testOktaLoginHandlerFailWithRestrictedGroups()
- public void testOktaLoginHandlerSuccessWithRestrictedGroups()
- public void testOktaLoginHandlerConflictingUsers()
- public void testOktaLoginHandlerGroupAssignment()
- public void testOktaLoginHandlerNoGroupAssignment()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Members
protected
- $autoFollowRedirection
- $usesDatabase
Methods
protected
- getAccessToken() — Get an Access Token
- getAssignGroupTestUser() — Get a user with a bunch of groups to test group assignment and sync on auth
- getAssignNoGroupTestUser() — Get a user with a bunch of groups to test group assignment and sync on auth
- getConflictingUser() — Get conflicting user, note same email as correct user ^
- getCorrectUser() — Get a user with a 'corret' claim on an email (as in they own the SS member email address)
- getIssuer() — Return issuer URI parts
- setSessionOnController() — Set a session on the current controller
- setupForLoginHandler() — Return an access token and provider for a supplied user and session
public
- setUp() — Log out the currently signed in user, if any, before any tests
- testOktaAuthenticateUrl() — Test that we can create an authentication URL from the Okta configuration
- testOktaLoginHandlerConflictingUsers() — That a user with the same email address can't link to current Member
- testOktaLoginHandlerFailWithRestrictedGroups()
- testOktaLoginHandlerGroupAssignment() — Test group assignment for an authenticating user with groups that intersect the current groups
- testOktaLoginHandlerNoGroupAssignment() — Test handling when a user presents with no groups
- testOktaLoginHandlerSuccessWithRestrictedGroups()