Interface AuthClientLoginOptions

interface AuthClientLoginOptions {
    identityProvider?: string | URL;
    maxTimeToLive?: bigint;
    allowPinAuthentication?: boolean;
    derivationOrigin?: string | URL;
    windowOpenerFeatures?: string;
    onSuccess?: OnSuccessFunc;
    onError?: OnErrorFunc;
    customValues?: Record<string, unknown>;
}

Properties

identityProvider?: string | URL

Identity provider

Default

"https://identity.ic0.app"
maxTimeToLive?: bigint

Expiration of the authentication in nanoseconds

Default

BigInt(8) hours * BigInt(3_600_000_000_000) nanoseconds
allowPinAuthentication?: boolean

If present, indicates whether or not the Identity Provider should allow the user to authenticate and/or register using a temporary key/PIN identity. Authenticating dapps may want to prevent users from using Temporary keys/PIN identities because Temporary keys/PIN identities are less secure than Passkeys (webauthn credentials) and because Temporary keys/PIN identities generally only live in a browser database (which may get cleared by the browser/OS).

derivationOrigin?: string | URL

Origin for Identity Provider to use while generating the delegated identity. For II, the derivation origin must authorize this origin by setting a record at <derivation-origin>/.well-known/ii-alternative-origins.

windowOpenerFeatures?: string

Auth Window feature config string

Example

"toolbar=0,location=0,menubar=0,width=500,height=500,left=100,top=100"
onSuccess?: OnSuccessFunc

Callback once login has completed

onError?: OnErrorFunc

Callback in case authentication fails

customValues?: Record<string, unknown>

Extra values to be passed in the login request during the authorize-ready phase