Skip to content

Overview

//trimble-id-android/com.trimble.id.android/Authenticator

Authenticator

class Authenticator(context: Context, configurationEndpoint: String, clientID: String, redirectUri: String, scope: String) : IAuthenticator

An authenticator that utilizes a custom URI callback.

Parameters

androidJvm

contextThe Context of the current state of our application.
configurationEndpointThe URL for the Trimble Identity OpenID well know configuration endpoint
clientIDThe Client identifier of the application
redirectUriRedirection Uri of the application
scopeThe scope of the application

Constructors

Authenticator[androidJvm]
constructor(context: Context, configurationEndpoint: String, clientID: String, redirectUri: String, scope: String)
Initialize authenticator. Only one instance of Authenticator should be used across the application

Functions

NameSummary
getAccessToken[androidJvm]
open suspend override fun getAccessToken(): String?
Get access token of authenticated user. If user is not logged in or tokens are not valid, it returns null. Perform login to continue
getUserInfo[androidJvm]
open suspend override fun getUserInfo(): User?
Get user claims of authenticated user. If user is not logged in or tokens are not valid, it returns null. Perform login to continue.
isLoggedIn[androidJvm]
open suspend override fun isLoggedIn(): Boolean
Get the logged in state.
login[androidJvm]
open override fun login(loginCallback: ILoginResponseCallback, launchAsTrustedWebActivity: Boolean)
Log the user in. Login only after invoking registerLoginLauncher.
logout[androidJvm]
open override fun logout(logoutCallback: ILogoutResponseCallback)
Log the user out. Logout only after invoking registerLogoutLauncher.
registerLoginLauncher[androidJvm]
open override fun registerLoginLauncher(context: AppCompatActivity)
Registers the login launcher. Result from login will be later handled by this function. This method needs to be invoked in the onCreate() or onStart() of the LifecycleOwner. It should be invoked before login.
registerLogoutLauncher[androidJvm]
open override fun registerLogoutLauncher(context: AppCompatActivity)
Registers the logout launcher. Result from logout will be later handled by this function. This method needs to be invoked in the onCreate() or onStart() of the LifecycleOwner. It should be invoked before logout.
withManagedUser[androidJvm]
open override fun withManagedUser(shortCode: String?): Authenticator
Fluent extension to enable Managed user login flow @see link
withPostLogoutRedirectUri[androidJvm]
open override fun withPostLogoutRedirectUri(postLogoutRedirectUri: String): Authenticator
Fluent extension for adding logout Uri