setServiceCredential
setServiceCredential(
serviceUrl,username,password,tokenExpirationMinutes?):Promise<void>
Defined in: src/auth.ts:128
Pre-generates a TokenCredential for a specific service URL and adds it directly to the
credential store, so that service uses a dedicated login independently of any other challenge-
handler credential. Use this when different services require different logins.
The token is minted eagerly (the call suspends until the server responds), then stored scoped
to serviceUrl. If a credential for that URL already exists in the store it is replaced
(the SDK’s add(for:) / add(credential, url) overload updates the entry for that origin).
tokenExpirationMinutes is optional; the server’s default expiry is used when omitted.
Registered on the extras module to stay within the Android JVM 64 KB method-size limit.
Parameters
Section titled “Parameters”serviceUrl
Section titled “serviceUrl”string
username
Section titled “username”string
password
Section titled “password”string
tokenExpirationMinutes?
Section titled “tokenExpirationMinutes?”number
Returns
Section titled “Returns”Promise<void>