Protected
constructorOptional
_idpWindow: WindowOptional
_eventHandler: ((event) => void)Private
_identityPrivate
_keyPrivate
_chainPrivate
_storagePrivate
_createPrivate
Optional
_idpPrivate
Optional
_eventPrivate
_registerPrivate
_handlePrivate
_getPrivate
_handlePrivate
_removeStatic
createCreate an AuthClient to manage authentication and identity
Optional
options: { Options for creating an AuthClient
Optional
identity?: utils.agent.SignIdentity | PartialIdentityAn SignIdentity or PartialIdentity to authenticate via delegation.
Optional
storage?: AuthClientStorageAuthClientStorage
Optional storage with get, set, and remove. Uses IdbStorage by default
Optional
keytype to use for the base key
'ECDSA'
If you are using a custom storage provider that does not support CryptoKey storage,
you should use 'Ed25519' as the key type, as it can serialize to a string
Optional
idleOptions to handle idle timeouts
after 10 minutes, invalidates the identity
const authClient = await AuthClient.create({
idleOptions: {
disableIdle: true
}
})
AuthClient Login - Opens up a new window to authenticate with Internet Identity
Optional
options: types.AuthClientLoginOptionsOptions for logging in
const authClient = await AuthClient.create();
authClient.login({
identityProvider: 'http://<canisterID>.127.0.0.1:8000',
maxTimeToLive: BigInt (7) * BigInt(24) * BigInt(3_600_000_000_000), // 1 week
windowOpenerFeatures: "toolbar=0,location=0,menubar=0,width=500,height=500,left=100,top=100",
onSuccess: () => {
console.log('Login Successful!');
},
onError: (error) => {
console.error('Login Failed: ', error);
}
});
Tool to manage authentication and identity
See
AuthClient