core / com.schibsted.account.network.service.authentication / OAuthService

OAuthService

class OAuthService : BaseNetworkService

Constructors

<init>

OAuthService(environment: String, okHttpClient: OkHttpClient)

Functions

refreshToken

fun refreshToken(clientId: String, clientSecret: String, refreshToken: String): Call<TokenResponse>

Prepares and commands a synchronous request to refresh an access token.

tokenFromAuthCode

fun tokenFromAuthCode(clientId: String, clientSecret: String, authCode: String, redirectUri: String, scopes: Array<String>?, codeVerifier: String? = null): Call<TokenResponse>

Requests a token by providing an authentication code

tokenFromClientCredentials

fun tokenFromClientCredentials(clientId: String, clientSecret: String): Call<TokenResponse>

Requests client credentials that can be used to request client-authenticated requests.

tokenFromPassword

fun tokenFromPassword(clientId: String, clientSecret: String, username: String, password: String, vararg scopes: String): Call<TokenResponse>

Log in using identifier and password

tokenFromPasswordless

fun tokenFromPasswordless(clientId: String, clientSecret: String, identifier: String, code: String, passwordlessToken: String, vararg scopes: String): Call<TokenResponse>

Requests a token by providing an identifier and the auth code sent to it, plus the passwordless token received as a result of the request to have the auth code sent.

Inherited Functions

createService

open fun <T : Any!> createService(service: Class<T>): T

Creates a service to perform network interactions against.