This guide intends to outline the details needed for a developer to migrate from Java Auth SDK to Okta IDX SDK.
The previous version of this library, Okta Java Auth SDK, has been rewritten from the ground up as Okta IDX Java SDK. This was done to take advantage of the OIE features available via the IDX API.
Since we are using a different set of APIs and patterns, a new library was published starting with 1.0.0
- JDK 8 or JDK-11
- Apache Maven 3.6.x or later
To use this SDK, you will need to include the following dependencies:
For Apache Maven:
<dependency>
<groupId>com.okta.idx.sdk</groupId>
<artifactId>okta-idx-java-api</artifactId>
<version>${okta.sdk.version}</version>
</dependency>
where {okta.sdk.version}
is the Java IDX SDK version.
For Gradle:
compile "com.okta.idx.sdk:okta-idx-java-api:${okta.sdk.version}"
where okta.sdk.version
is the latest stable release version here.
For more information check out the IDX SDK Repository.
In order to use the IDXAuthenticationWrapper
client, you will need to configure additional properties. For more information, check out our embedded Auth guide.
The simplest way to construct a client is via code:
IDXAuthenticationWrapper idxAuthenticationWrapper = new IDXAuthenticationWrapper(
"{issuer}",
"{clientId}",
"{clientSecret}",
"{scopes}", // space separated e.g. "openid email profile"
"{redirectUri}"); // should match your app redirect uri set via console
Note: For additional configuration options, check out the IDX SDK Configuration Reference.
In the table below, you can see the methods available in the IDX client and their equivalent ones in the Auth SDK. For guidance about usage, check out here.
Before | Now | Description |
---|---|---|
authenticate |
authenticate |
Authenticates a user with username/password credentials |
resetPassword recoverPassword |
recoverPassword |
Changes user''s password |
activateFactor verifyFactor |
selectFactor |
Activate a factor |
skip |
skipAuthenticatorEnrollment |
Skips an optional authenticator during enrollment/verification |
answerRecoveryQuestion cancel |
N/A | Out of Scope |
verifyActivation sendActivationEmail resendVerifyFactor resendActivateFactor |
N/A | |
unlockAccount verifyUnlockAccount |
N/A |
Similar to the Auth SDK, the IDX wrapper client return a response with an Authentication status that indicates how to proceed with the authentication flow. Check out the Authentication Status section here for more details.
The SDK throws ProcessingException
everytime the server responds with an invalid status code, or if there is an internal error. You can get more information by calling exception.getErrorResponse()
.
If you have questions about this library or about the Okta APIs, post a question on our Developer Forum.
If you find a bug or have a feature request for the IDX library specifically, post an issue here on GitHub.