Package com.ocient.auth
Class OktaAuthenticators.OktaNativeSSOClient
java.lang.Object
com.ocient.auth.OktaAuthenticators.OktaNativeSSOClient
- Enclosing class:
- OktaAuthenticators
public static class OktaAuthenticators.OktaNativeSSOClient extends Object
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 Constructor Description OktaNativeSSOClient() -
Method Summary
-
Constructor Details
-
OktaNativeSSOClient
public OktaNativeSSOClient()
-
-
Method Details
-
createAuthorizationCodeGrant
public static OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OktaAuthenticators.OktaNativeSSOToken> createAuthorizationCodeGrant(OpenIDAuthenticators.AuthorizationCodeWithPKCEClient client, ClientWireProtocol.OpenIDAuthenticator authenticator) throws ExceptionReturns aOpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrantthat yields anOktaAuthenticators.OktaNativeSSOTokenon authorization success.- Parameters:
client- an instance ofOpenIDAuthenticators.AuthorizationCodeWithPKCEClientauthenticator- the Authorization Server- Returns:
OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant- Throws:
Exception
-
createDeviceAuthorizationGrant
public static OpenIDAuthenticators.DeviceAuthorizationGrant<OktaAuthenticators.OktaNativeSSOToken> createDeviceAuthorizationGrant(ClientWireProtocol.OpenIDAuthenticator authenticator) throws ExceptionReturns aOpenIDAuthenticators.DeviceAuthorizationGrantthat yields anOktaAuthenticators.OktaNativeSSOTokenon authorization success.- Parameters:
authenticator- the Authorization Server- Returns:
OpenIDAuthenticators.DeviceAuthorizationGrant- Throws:
Exception- when any exception occurs
-
exchangeForOAuthToken
public static OpenIDAuthenticators.OAuthToken exchangeForOAuthToken(OktaAuthenticators.OktaNativeSSOToken oktaToken) throws ExceptionSends 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:
Exception- when any exception occurs
-
revoke
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:
Exception- when any exception occurs
-