CredentialProvider

class CredentialProvider(storage: ERROR CLASS: Symbol not found for CredentialStorage, sampleConfig: ERROR CLASS: Symbol not found for SampleConfig) : <ERROR CLASS> ERROR CLASS: Loop in supertypes involving io/rekast/sdk/app/network/CredentialProvider

App implementation of CredentialProvider.

Reads credentials from CredentialStorage (backed by EncryptedSharedPreferences) so that the SDK's interceptors always receive the most recent values without the SDK needing to store or manage credentials itself.

The API key is only returned when there is no valid access token, ensuring that Basic Auth headers are attached only during the token-exchange phase and Bearer token is used thereafter.

Constructors

Link copied to clipboard
constructor(storage: ERROR CLASS: Symbol not found for CredentialStorage, sampleConfig: ERROR CLASS: Symbol not found for SampleConfig)

Functions

Link copied to clipboard
open override fun getAccessToken(): String

Returns the current Bearer access token from CredentialStorage, or an empty string if it has expired or has not yet been obtained.

Link copied to clipboard
open override fun getApiKey(): String

Returns the API key for Basic Authentication, or an empty string when a valid Bearer access token is already available.

Link copied to clipboard
open override fun getApiUserId(): String

Returns the API user ID from static app configuration.