Package com.ocient.auth
Class OktaAuthenticators.OktaNativeSSOClient
java.lang.Object
com.ocient.auth.OktaAuthenticators.OktaNativeSSOClient
- Enclosing class:
OktaAuthenticators
From https://developer.okta.com/docs/guides/configure-native-sso/main
Native SSO allows you to protect native OpenID Connect applications, such as desktop apps and mobile apps, and achieve Single Sign-On (SSO) and Single Logout (SLO) between these applications. SSO between browser-based web applications is achieved by leveraging shared cookies. Unlike web applications, native applications can't use web cookies. Okta offers a token-based approach to achieve SSO between native applications. See OpenID Connect and OAuth 2.0 API for more information on the OAuth 2.0 and OpenID Connect endpoints.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OktaAuthenticators.OktaNativeSSOToken> createAuthorizationCodeGrant(OpenIDAuthenticators.AuthorizationCodeWithPKCEClient client, ClientWireProtocol.OpenIDAuthenticator authenticator) Returns aOpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrantthat yields anOktaAuthenticators.OktaNativeSSOTokenon authorization success.Returns aOpenIDAuthenticators.DeviceAuthorizationGrantthat yields anOktaAuthenticators.OktaNativeSSOTokenon authorization success.Sends a request to the /token endpoint for the Authorization Server that issued this device token.static voidrevoke(OktaAuthenticators.OktaNativeSSOToken oktaToken) Sends a request to the /revoke endpoint for the Authorization Server that issued this device token.
-
Constructor Details
-
OktaNativeSSOClient
public OktaNativeSSOClient()
-
-
Method Details
-
createAuthorizationCodeGrant
public static OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OktaAuthenticators.OktaNativeSSOToken> createAuthorizationCodeGrant(OpenIDAuthenticators.AuthorizationCodeWithPKCEClient client, ClientWireProtocol.OpenIDAuthenticator authenticator) throws AuthException, KeyManagementException, UnsupportedEncodingException, MalformedURLException, NoSuchAlgorithmException, KeyStoreException, IOException Returns aOpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrantthat yields anOktaAuthenticators.OktaNativeSSOTokenon authorization success.- Parameters:
client- an instance ofOpenIDAuthenticators.AuthorizationCodeWithPKCEClientauthenticator- the Authorization Server- Returns:
OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant- Throws:
AuthExceptionIOExceptionKeyStoreExceptionNoSuchAlgorithmExceptionMalformedURLExceptionUnsupportedEncodingExceptionKeyManagementException
-
createDeviceAuthorizationGrant
public static OpenIDAuthenticators.DeviceAuthorizationGrant<OktaAuthenticators.OktaNativeSSOToken> createDeviceAuthorizationGrant(ClientWireProtocol.OpenIDAuthenticator authenticator) throws AuthException, KeyManagementException, MalformedURLException, NoSuchAlgorithmException, KeyStoreException, IOException, TimeoutException Returns aOpenIDAuthenticators.DeviceAuthorizationGrantthat yields anOktaAuthenticators.OktaNativeSSOTokenon authorization success.- Parameters:
authenticator- the Authorization Server- Returns:
OpenIDAuthenticators.DeviceAuthorizationGrant- Throws:
AuthExceptionIOExceptionKeyStoreExceptionNoSuchAlgorithmExceptionMalformedURLExceptionKeyManagementExceptionTimeoutException
-
exchangeForOAuthToken
public static OpenIDAuthenticators.OAuthToken exchangeForOAuthToken(OktaAuthenticators.OktaNativeSSOToken oktaToken) throws KeyManagementException, MalformedURLException, NoSuchAlgorithmException, KeyStoreException, IOException Sends a request to the /token endpoint for the Authorization Server that issued this device token. The token request uses the device secret to obtain a new set of id, access and refresh tokens from the Authorization Server.- Parameters:
oktaToken- theOktaAuthenticators.OktaNativeSSOToken- Returns:
- an
OpenIDAuthenticators.OAuthToken - Throws:
IOExceptionKeyStoreExceptionNoSuchAlgorithmExceptionMalformedURLExceptionKeyManagementException
-
revoke
public static void revoke(OktaAuthenticators.OktaNativeSSOToken oktaToken) throws KeyManagementException, MalformedURLException, NoSuchAlgorithmException, KeyStoreException, IOException Sends a request to the /revoke endpoint for the Authorization Server that issued this device token. The revoke request signs the user out from all of the apps that are a part of the Native SSO flow.- Parameters:
oktaToken- theOktaAuthenticators.OktaNativeSSOToken- Throws:
IOExceptionKeyStoreExceptionNoSuchAlgorithmExceptionMalformedURLExceptionKeyManagementException
-