Package com.ocient.auth

# Class OktaAuthenticators.OktaAuthenticationClient

java.lang.Object
com.ocient.auth.OktaAuthenticators.OktaAuthenticationClient

Enclosing class:
  `OktaAuthenticators`

public static class OktaAuthenticators.OktaAuthenticationClient extends Object

## Constructor Summary

Constructors
Constructor
Description
`OktaAuthenticationClient()`

## Method Summary

Modifier and Type
Method
Description
`static String`
`createSessionToken(ClientWireProtocol.OpenIDAuthenticator authenticator, String oktaUsername, char[] oktaPassword)`
Authenticate the user with the Okta issuer and return the session token
`static OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OpenIDAuthenticators.OAuthToken>`
`exchangeSessionToken(OpenIDAuthenticators.AuthorizationCodeWithPKCEClient client, ClientWireProtocol.OpenIDAuthenticator authenticator, String sessionToken)`
Exchanges the given session token for an OAuth Token

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

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

## Constructor Details

### OktaAuthenticationClient

public OktaAuthenticationClient()

## Method Details

### createSessionToken

public static String createSessionToken(ClientWireProtocol.OpenIDAuthenticator authenticator, String oktaUsername, char[] oktaPassword) throws com.okta.authn.sdk.AuthenticationException, AuthException
Authenticate the user with the Okta issuer and return the session token

See https://developer.okta.com/docs/reference/api/authn/

Parameters:
  `authenticator` -
  `oktaUsername` -
  `oktaPassword` -
Returns:
Throws:
  `com.okta.authn.sdk.AuthenticationException`
  `AuthException`

### exchangeSessionToken

public static OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OpenIDAuthenticators.OAuthToken> exchangeSessionToken(OpenIDAuthenticators.AuthorizationCodeWithPKCEClient client, ClientWireProtocol.OpenIDAuthenticator authenticator, String sessionToken) throws KeyManagementException, UnsupportedEncodingException, MalformedURLException, NoSuchAlgorithmException, KeyStoreException, IOException, InterruptedException
Exchanges the given session token for an OAuth Token

Parameters:
  `client` -
  `authenticator` -
  `sessionToken` -
Returns:
Throws:
  `IOException`
  `KeyStoreException`
  `NoSuchAlgorithmException`
  `MalformedURLException`
  `UnsupportedEncodingException`
  `KeyManagementException`
  `InterruptedException`