OAuth2Client

class OAuth2Client(val clientId: String, val scope: String, val redirectUri: String, val signOutRedirectUri: String, val serverConfig: ServerConfig)

Class to handle OAuth2 related endpoint

Constructors

Link copied to clipboard
constructor(clientId: String, scope: String, redirectUri: String, signOutRedirectUri: String, serverConfig: ServerConfig)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

The registered client identifier

Link copied to clipboard
Link copied to clipboard
private val okHttpClient: OkHttpClient
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun endSession(idToken: String, listener: FRListener<Void?>)

End the user session with end session endpoint.

Link copied to clipboard
fun endSessionWithBrowser(idToken: String, oAuth2Client: OAuth2Client, appAuthConfiguration: AppAuthConfiguration, listener: FRListener<Void?>)

End the user session with end session endpoint with browser. This method will open the browser to end the session.

Link copied to clipboard
fun exchangeToken(token: SSOToken, additionalParameters: Map<String, String>, listener: FRListener<AccessToken>)

Sends an authorization request to the authorization service.

Link copied to clipboard
Link copied to clipboard
private fun getAuthorizeUrl(pkce: PKCE, state: String, additionalParameters: Map<String, String>): URL
Link copied to clipboard
fun getEndSessionUrl(clientId: String?, idToken: String?): URL
Link copied to clipboard
fun refresh(sessionToken: SSOToken?, refreshToken: String, listener: FRListener<AccessToken>)

Refresh the Access Token with the provided Refresh Token

Link copied to clipboard
fun revoke(accessToken: AccessToken, listener: FRListener<Void?>)

Revoke the AccessToken, to revoke the access token, first look for refresh token to revoke, if not provided, will revoke with the access token.

fun revoke(accessToken: AccessToken, useRefreshToken: Boolean, listener: FRListener<Void?>)

Revoke the AccessToken, to revoke the access token, first look for refresh token to revoke, if not provided or useRefreshToken = false, will revoke with the access token.

Link copied to clipboard
fun token(sessionToken: SSOToken?, code: String, pkce: PKCE, additionalParameters: Map<String, String>, handler: OAuth2ResponseHandler, listener: FRListener<AccessToken>)

Sends an token request to the authorization service.