Overview
//trimble-id-android/com.trimble.id.android/Authenticator
Authenticator
open class Authenticator(context: Context, configurationEndpoint: String, clientID: String, redirectUri: String, scope: String) : IAuthenticator
An authenticator that utilizes a custom URI callback.
Parameters
androidJvm
| context | The Context of the current state of our application. |
| configurationEndpoint | The URL for the Trimble Identity OpenID well know configuration endpoint |
| clientID | The Client identifier of the application |
| redirectUri | Redirection Uri of the application |
| scope | The 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
| Name | Summary |
|---|---|
| getAccessToken | [androidJvm] open suspend override fun getAccessToken(): String? Get access token of authenticated user. If user is not logged 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 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, forceNewLogin: 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() method of an Activity or the onViewCreated method of a Fragment. 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() method of an Activity or the onViewCreated method of a Fragment. 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 |
| withOfflineMode | [androidJvm] open override fun withOfflineMode(): Authenticator Fluent extension to enable offline mode. Offline mode allows the user to login without internet connection. |
| withPostLogoutRedirectUri | [androidJvm] open override fun withPostLogoutRedirectUri(postLogoutRedirectUri: String): Authenticator Fluent extension for adding logout Uri |