public class DefaultAuthenticationClient extends com.okta.sdk.impl.client.BaseClient implements AuthenticationClient
| Constructor and Description |
|---|
DefaultAuthenticationClient(com.okta.sdk.impl.util.BaseUrlResolver baseUrlResolver,
com.okta.sdk.client.Proxy proxy,
com.okta.sdk.cache.CacheManager cacheManager,
com.okta.sdk.client.AuthenticationScheme authenticationScheme,
com.okta.sdk.impl.http.authc.RequestAuthenticatorFactory requestAuthenticatorFactory,
int connectionTimeout)
Deprecated.
|
DefaultAuthenticationClient(com.okta.sdk.impl.config.ClientConfiguration clientConfiguration)
Instantiates a new AuthenticationClient instance that will communicate with the Okta REST API.
|
| Modifier and Type | Method and Description |
|---|---|
AuthenticationResponse |
activateFactor(String factorId,
ActivateFactorRequest request,
AuthenticationStateHandler stateHandler)
The sms, call and token:software:totp factor types require activation to complete the enrollment process.
|
AuthenticationResponse |
answerRecoveryQuestion(RecoveryQuestionAnswerRequest request,
AuthenticationStateHandler stateHandler)
Answers the user’s recovery question to ensure only the end user redeemed the recovery token for recovery transaction
with a RECOVERY status.
|
AuthenticationResponse |
answerRecoveryQuestion(String answer,
String stateToken,
AuthenticationStateHandler stateHandler)
Answers the user’s recovery question to ensure only the end user redeemed the recovery token for recovery transaction
with a RECOVERY status.
|
AuthenticationResponse |
authenticate(AuthenticationRequest request,
AuthenticationStateHandler stateHandler)
Initiates a username and password login against Okta's Authentication API.
|
AuthenticationResponse |
authenticate(String username,
char[] password,
String relayState,
AuthenticationStateHandler stateHandler)
Initiates a username and password login against Okta's Authentication API.
|
AuthenticationResponse |
cancel(String stateToken)
Cancels the current transaction and revokes the state token.
|
AuthenticationResponse |
challengeFactor(String factorId,
String stateToken,
AuthenticationStateHandler stateHandler)
Requests a challenge factor be sent to the user via the corresponding {code}factorId{code}.
|
AuthenticationResponse |
changePassword(ChangePasswordRequest changePasswordRequest,
AuthenticationStateHandler stateHandler)
This operation changes a user’s password by providing the existing password and the new password password for authentication transactions with either the PASSWORD_EXPIRED or PASSWORD_WARN state.
|
AuthenticationResponse |
changePassword(char[] oldPassword,
char[] newPassword,
String stateToken,
AuthenticationStateHandler stateHandler)
This operation changes a user’s password by providing the existing password and the new password password for authentication transactions with either the PASSWORD_EXPIRED or PASSWORD_WARN state.
|
AuthenticationResponse |
enrollFactor(FactorEnrollRequest request,
AuthenticationStateHandler stateHandler)
Enrolls a user with a factor assigned by their MFA Policy.
|
AuthenticationResponse |
enrollFactor(com.okta.sdk.resource.user.factor.FactorType type,
com.okta.sdk.resource.user.factor.FactorProvider provider,
com.okta.sdk.resource.user.factor.FactorProfile profile,
String stateToken,
AuthenticationStateHandler stateHandler)
Enrolls a user with a factor assigned by their MFA Policy.
|
AuthenticationResponse |
previous(String stateToken,
AuthenticationStateHandler stateHandler)
Moves the current transaction state back to the previous state.
|
AuthenticationResponse |
recoverPassword(RecoverPasswordRequest request,
AuthenticationStateHandler stateHandler)
Starts a new password recovery transaction for a given user and issues a recovery token that can be used to reset a user’s password.
|
AuthenticationResponse |
recoverPassword(String username,
com.okta.sdk.resource.user.factor.FactorType factorType,
String relayState,
AuthenticationStateHandler stateHandler)
Starts a new password recovery transaction for a given user and issues a recovery token that can be used to reset a user’s password.
|
AuthenticationResponse |
resendActivateFactor(String factorId,
String stateToken,
AuthenticationStateHandler stateHandler)
Resend an activation factor challenge to a user.
|
AuthenticationResponse |
resendVerifyFactor(String factorId,
String stateToken,
AuthenticationStateHandler stateHandler)
Resend a factor verification challenge to a user.
|
AuthenticationResponse |
resetPassword(ChangePasswordRequest request,
AuthenticationStateHandler stateHandler)
Resets a user’s password to complete a recovery transaction with a PASSWORD_RESET state.
|
AuthenticationResponse |
resetPassword(char[] newPassword,
String stateToken,
AuthenticationStateHandler stateHandler)
Resets a user’s password to complete a recovery transaction with a PASSWORD_RESET state.
|
AuthenticationResponse |
skip(String stateToken,
AuthenticationStateHandler stateHandler)
Skip the current transaction state and advance to the next state.
|
AuthenticationResponse |
unlockAccount(String username,
com.okta.sdk.resource.user.factor.FactorType factorType,
String relayState,
AuthenticationStateHandler stateHandler)
Starts a new unlock recovery transaction for a given user and issues a recovery token that can be used to unlock a user’s account.
|
AuthenticationResponse |
unlockAccount(UnlockAccountRequest request,
AuthenticationStateHandler stateHandler)
Starts a new unlock recovery transaction for a given user and issues a recovery token that can be used to unlock a user’s account.
|
AuthenticationResponse |
verifyActivation(String factorId,
String stateToken,
AuthenticationStateHandler stateHandler)
Returns the state of factor's activation.
|
AuthenticationResponse |
verifyFactor(String factorId,
String stateToken,
AuthenticationStateHandler stateHandler)
Verifies the state of a factor.
|
AuthenticationResponse |
verifyFactor(String factorId,
VerifyFactorRequest request,
AuthenticationStateHandler stateHandler)
Verifies an enrolled factor for an authentication transaction with the MFA_REQUIRED or MFA_CHALLENGE state
|
AuthenticationResponse |
verifyRecoveryToken(String recoveryToken,
AuthenticationStateHandler stateHandler)
Validates a recovery token that was distributed to the end user to continue the recovery transaction.
|
AuthenticationResponse |
verifyUnlockAccount(com.okta.sdk.resource.user.factor.FactorType factorType,
VerifyRecoveryRequest request,
AuthenticationStateHandler stateHandler)
Verifies a recovery challenge sent to the user for primary authentication for a recovery transaction with RECOVERY_CHALLENGE status.
|
create, createDataStore, createRequestExecutor, createRequestExecutor, delete, getCacheManager, getClientCredentials, getDataStore, getResource, http, instantiate, saveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDataStore, instantiate@Deprecated public DefaultAuthenticationClient(com.okta.sdk.impl.util.BaseUrlResolver baseUrlResolver, com.okta.sdk.client.Proxy proxy, com.okta.sdk.cache.CacheManager cacheManager, com.okta.sdk.client.AuthenticationScheme authenticationScheme, com.okta.sdk.impl.http.authc.RequestAuthenticatorFactory requestAuthenticatorFactory, int connectionTimeout)
baseUrlResolver - Okta base URL resolverproxy - the HTTP proxy to be used when communicating with the Okta API server (can be
null)cacheManager - the CacheManager that should be used to cache
Okta REST resources (can be null)authenticationScheme - the HTTP authentication scheme to be used when communicating with the Okta API
server (can be null)requestAuthenticatorFactory - factory used to handle creating authentication requestsconnectionTimeout - connection timeout in secondspublic DefaultAuthenticationClient(com.okta.sdk.impl.config.ClientConfiguration clientConfiguration)
clientConfiguration - the ClientConfiguration containing the connection informationpublic AuthenticationResponse authenticate(String username, char[] password, String relayState, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientauthenticate in interface AuthenticationClientusername - User’s non-qualified short-name (e.g. dade.murphy) or unique fully-qualified login (e.g dade.murphy@example.com)password - User’s password credentialrelayState - Optional state value that is persisted for the lifetime of the authentication transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationFailureException - when username or password are invalidAuthenticationException - any other authentication related errorpublic AuthenticationResponse authenticate(AuthenticationRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientauthenticate in interface AuthenticationClientrequest - a request object holds all attributes sent to the remote API.stateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationFailureException - when username or password are invalidAuthenticationException - any other authentication related errorpublic AuthenticationResponse changePassword(char[] oldPassword, char[] newPassword, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientchangePassword in interface AuthenticationClientoldPassword - User’s current password that is expired or about to expirenewPassword - New password for userstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineCredentialsException - thrown if old password is invalid, or the new password fails to meet the
requirements of the password policyAuthenticationException - any other authentication related errorpublic AuthenticationResponse changePassword(ChangePasswordRequest changePasswordRequest, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientchangePassword in interface AuthenticationClientchangePasswordRequest - a request object holds all attributes sent to the remote API.stateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineCredentialsException - thrown if old password is invalid, or the new password fails to meet the
requirements of the password policyAuthenticationException - any other authentication related errorpublic AuthenticationResponse resetPassword(char[] newPassword, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientresetPassword in interface AuthenticationClientnewPassword - User’s new passwordstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineCredentialsException - thrown if old password is invalid, or the new password fails to meet the
requirements of the password policyAuthenticationException - any other authentication related errorpublic AuthenticationResponse resetPassword(ChangePasswordRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientresetPassword in interface AuthenticationClientrequest - a request object holds all attributes sent to the remote APIstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineCredentialsException - thrown if old password is invalid, or the new password fails to meet the
requirements of the password policyAuthenticationException - any other authentication related errorpublic AuthenticationResponse recoverPassword(String username, com.okta.sdk.resource.user.factor.FactorType factorType, String relayState, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientrecoverPassword in interface AuthenticationClientusername - User’s non-qualified short-name (e.g. dade.murphy) or unique fully-qualified login (dade.murphy@example.com)factorType - Recovery factor to use for primary authenticationrelayState - Optional state value that is persisted for the lifetime of the recovery transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse challengeFactor(String factorId, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientchallengeFactor in interface AuthenticationClientfactorId - id of factor returned from enrollmentstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse verifyFactor(String factorId, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientverifyFactor in interface AuthenticationClientfactorId - id of factor returned from enrollmentstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse verifyFactor(String factorId, VerifyFactorRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientverifyFactor in interface AuthenticationClientfactorId - id of factor returned from enrollmentrequest - the request object containing the required attributes to fulfill the verificationstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse activateFactor(String factorId, ActivateFactorRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientactivateFactor in interface AuthenticationClientfactorId - id of factor returned from enrollmentrequest - the request object containing the required attributes to fulfill the activationstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse recoverPassword(RecoverPasswordRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientrecoverPassword in interface AuthenticationClientrequest - a request object holds all attributes sent to the remote API.stateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse verifyUnlockAccount(com.okta.sdk.resource.user.factor.FactorType factorType, VerifyRecoveryRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientverifyUnlockAccount in interface AuthenticationClientfactorType - type of factorrequest - the request object containing the required attributes to fulfill this challengestateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse unlockAccount(String username, com.okta.sdk.resource.user.factor.FactorType factorType, String relayState, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientunlockAccount in interface AuthenticationClientusername - User’s non-qualified short-name (dade.murphy) or unique fully-qualified login (dade.murphy@example.com)factorType - Recovery factor to use for primary authenticationrelayState - Optional state value that is persisted for the lifetime of the recovery transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse unlockAccount(UnlockAccountRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientunlockAccount in interface AuthenticationClientrequest - a request object holds all attributes sent to the remote API.stateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse answerRecoveryQuestion(String answer, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientanswerRecoveryQuestion in interface AuthenticationClientanswer - answer to user’s recovery questionstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineInvalidRecoveryAnswerException - thrown when the answer is invalidAuthenticationException - any other authentication related errorpublic AuthenticationResponse answerRecoveryQuestion(RecoveryQuestionAnswerRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientanswerRecoveryQuestion in interface AuthenticationClientrequest - a request object holds all attributes sent to the remote API.stateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineInvalidRecoveryAnswerException - thrown when the answer is invalidAuthenticationException - any other authentication related errorpublic AuthenticationResponse enrollFactor(com.okta.sdk.resource.user.factor.FactorType type, com.okta.sdk.resource.user.factor.FactorProvider provider, com.okta.sdk.resource.user.factor.FactorProfile profile, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientenrollFactor in interface AuthenticationClienttype - type of factorprovider - factor providerprofile - profile of a supported factorstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse enrollFactor(FactorEnrollRequest request, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientenrollFactor in interface AuthenticationClientrequest - a request object holds all attributes sent to the remote API.stateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse previous(String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientprevious in interface AuthenticationClientstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse skip(String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientskip in interface AuthenticationClientstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse cancel(String stateToken)
AuthenticationClientcancel in interface AuthenticationClientstateToken - state token for current transactionpublic AuthenticationResponse resendActivateFactor(String factorId, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientresendActivateFactor in interface AuthenticationClientfactorId - id of factor returned from enrollmentstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse resendVerifyFactor(String factorId, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientresendVerifyFactor in interface AuthenticationClientfactorId - id of factor returned from enrollmentstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse verifyActivation(String factorId, String stateToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientverifyActivation in interface AuthenticationClientstateToken - state token for current transactionstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorpublic AuthenticationResponse verifyRecoveryToken(String recoveryToken, AuthenticationStateHandler stateHandler) throws AuthenticationException
AuthenticationClientverifyRecoveryToken in interface AuthenticationClientrecoveryToken - Recovery token that was distributed to the end user via out-of-band mechanism such as emailstateHandler - State handler that handles the resulting status change corresponding to the Okta authentication state machineAuthenticationException - any other authentication related errorCopyright © 2018 Okta. All rights reserved.