OAuth2Client

open class OAuth2Client

Class to handle OAuth2 related endpoint

Constructors

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

Properties

Link copied to clipboard
private val APPLICATION_X_WWW_FORM_URLENCODED: String = "application/x-www-form-urlencoded"
Link copied to clipboard
private val AUTHORIZE: Action
Link copied to clipboard
private open var clientId: String
The registered client identifier
Link copied to clipboard
private val CONTENT_TYPE: String = "Content-Type"
Link copied to clipboard
private val END_SESSION: Action
Link copied to clipboard
private val EXCHANGE_TOKEN: Action
Link copied to clipboard
private open var okHttpClient: OkHttpClient
Link copied to clipboard
private open var redirectUri: String
Link copied to clipboard
private val REFRESH_TOKEN: Action
Link copied to clipboard
private open var responseType: String
Link copied to clipboard
private val REVOKE_TOKEN: Action
Link copied to clipboard
private open var scope: String
Link copied to clipboard
private open var serverConfig: ServerConfig
Link copied to clipboard
private val STATE_LENGTH: Int = 16
Link copied to clipboard
private val TAG: String = "OAuth2Client"

Functions

Link copied to clipboard
open fun endSession(@NonNull idToken: String, listener: FRListener<Void>)
End the user session with end session endpoint.
Link copied to clipboard
open fun exchangeToken(@NonNull token: SSOToken, @NonNull additionalParameters: Map<String, String>, listener: FRListener<AccessToken>)
Sends an authorization request to the authorization service.
Link copied to clipboard
private open fun generateCodeChallenge(): PKCE
Link copied to clipboard
open fun generateState(): String
Link copied to clipboard
open fun getAuthorizeUrl(): URL
private open fun getAuthorizeUrl(token: Token, pkce: PKCE, state: String, additionalParameters: Map<String, String>): URL
Link copied to clipboard
open fun getClientId(): String
Link copied to clipboard
open fun getEndSessionUrl(clientId: String, idToken: String): URL
Link copied to clipboard
private open fun getOkHttpClient(): OkHttpClient
Link copied to clipboard
open fun getRedirectUri(): String
Link copied to clipboard
open fun getResponseType(): String
Link copied to clipboard
open fun getRevokeUrl(): URL
Link copied to clipboard
open fun getScope(): String
Link copied to clipboard
Link copied to clipboard
open fun getTokenUrl(): URL
Link copied to clipboard
open fun refresh(@Nullable sessionToken: SSOToken, @NonNull refreshToken: String, listener: FRListener<AccessToken>)
Refresh the Access Token with the provided Refresh Token
Link copied to clipboard
open fun revoke(@NonNull 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.
open fun revoke(@NonNull 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
open fun token(@Nullable sessionToken: SSOToken, @NonNull code: String, pkce: PKCE, additionalParameters: Map<String, String>, handler: OAuth2ResponseHandler, listener: FRListener<AccessToken>)
Sends an token request to the authorization service.