Skip to content

scopedKeys

scopedKeys<P, K>(params): `openid:${{ apple: "https://appleid.apple.com"; google: "https://accounts.google.com"; microsoft: "https://login.microsoftonline.com/{tid}/v2.0" }[P]}:${K}`[]

Defined in: src/client/auth-client.ts:1691

Scopes attribute keys to an OpenID provider.

When using one-click sign-in, attributes can be scoped to the same provider so the user grants access in a single step without an additional prompt.

P extends "google" | "apple" | "microsoft"

K extends string = "name" | "email" | "verified_email"

readonly K[]

The attribute keys to scope. Defaults to ['name', 'email', 'verified_email'].

P

The OpenID provider the keys should be scoped to.

undefined

`openid:${{ apple: "https://appleid.apple.com"; google: "https://accounts.google.com"; microsoft: "https://login.microsoftonline.com/{tid}/v2.0" }[P]}:${K}`[]

The scoped attribute keys as openid:<provider-url>:<key>.

scopedKeys({ openIdProvider: 'google', keys: ['email'] });
// ['openid:https://accounts.google.com:email']

scopedKeys<D, K>(params): `sso:${Lowercase<D>}:${K}`[]

Defined in: src/client/auth-client.ts:1714

Scopes attribute keys to an organization’s SSO.

When using one-click SSO sign-in, attributes can be scoped to the same organization so the user grants access in a single step.

D extends string

K extends string = "name" | "email"

readonly K[]

The attribute keys to scope. Defaults to ['name', 'email']; verified_email is not available for an organization SSO.

undefined

D

The organization domain the keys should be scoped to.

`sso:${Lowercase<D>}:${K}`[]

The scoped attribute keys as sso:<domain>:<key>.

scopedKeys({ ssoDomain: 'dfinity.org', keys: ['email'] });
// ['sso:dfinity.org:email']