Package com.ocient.auth

# Class OktaAuthenticators.OktaNativeSSOToken

java.lang.Object
com.ocient.auth.OpenIDAuthenticators.OAuthToken
com.ocient.auth.OktaAuthenticators.OktaNativeSSOToken

All Implemented Interfaces:
  `Token`

Enclosing class:
  OktaAuthenticators

    public static class OktaAuthenticators.OktaNativeSSOToken
    extends OpenIDAuthenticators.OAuthToken

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
--- | ---
`OktaNativeSSOToken​(ClientWireProtocol.OpenIDAuthenticator authenticator, com.google.gson.JsonObject tokenResponse)` |

## Method Summary

Modifier and Type | Method | Description
--- | --- | ---
`static OktaAuthenticators.OktaNativeSSOToken` | `decrypt​(byte[] passphrase, InputStream input)` | Decrypts the `OktaAuthenticators.OktaNativeSSOToken` using the secret provided
`byte[]` | `encrypt​(byte[] passphrase)` | Encrypts the `OktaAuthenticators.OktaNativeSSOToken`
`String` | `getToken()` |
`String` | `getTokenHint()` |

### Methods inherited from class com.ocient.auth.OpenIDAuthenticators.OAuthToken

`getTokenResponse`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### OktaNativeSSOToken

public OktaNativeSSOToken​(ClientWireProtocol.OpenIDAuthenticator authenticator, com.google.gson.JsonObject tokenResponse)

## Method Details

### getTokenHint

public String getTokenHint()

Specified by:
  `getTokenHint` in interface `Token`
Overrides:
  `getTokenHint` in class `OpenIDAuthenticators.OAuthToken`
Returns:
  the token hint to forward to the database

### getToken

public String getToken()

Specified by:
  `getToken` in interface `Token`
Overrides:
  `getToken` in class `OpenIDAuthenticators.OAuthToken`
Returns:
  the token payload

### encrypt

public byte[] encrypt​(byte[] passphrase) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, IOException, InvalidKeySpecException, InvalidAlgorithmParameterException, com.nimbusds.jose.JOSEException
Encrypts the `OktaAuthenticators.OktaNativeSSOToken`

Parameters:
  `passphrase` -
Throws:
  `InvalidKeyException`
  `NoSuchAlgorithmException`
  `NoSuchPaddingException`
  `IllegalBlockSizeException`
  `BadPaddingException`
  `IOException`
  `InvalidKeySpecException`
  `InvalidAlgorithmParameterException`
  `com.nimbusds.jose.JOSEException`

### decrypt

public static OktaAuthenticators.OktaNativeSSOToken decrypt​(byte[] passphrase, InputStream input) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, IOException, AuthException, ParseException, com.nimbusds.jose.JOSEException
Decrypts the `OktaAuthenticators.OktaNativeSSOToken` using the secret provided

Parameters:
  `passphrase` -
  `input` -
Returns:
Throws:
  `InvalidKeyException`
  `NoSuchAlgorithmException`
  `NoSuchPaddingException`
  `IllegalBlockSizeException`
  `BadPaddingException`
  `IOException`
  `AuthException`
  `ParseException`
  `com.nimbusds.jose.JOSEException`