Skip to content

isValidSsoDomain

isValidSsoDomain(domain, signal): Promise<boolean>

Defined in: src/client/sso.ts:93

Checks whether an organization domain can be used for SSO sign-in: it is a domain name, and it publishes /.well-known/ii-openid-configuration with a client_id and an openid_configuration URL.

The document must be served with Access-Control-Allow-Origin: *.

The check waits on a third-party server and has no deadline of its own, so signal sets one. Pass AbortSignal.timeout(...) for a one-shot check, or a controller you abort per keystroke when checking as the user types.

string

The organization domain.

AbortSignal

Bounds the check.

Promise<boolean>

Whether the domain is usable for SSO sign-in.

When signal aborts — an abandoned check is not a verdict on the domain, so it must not be read as false.

if (await isValidSsoDomain(input.value, AbortSignal.timeout(5_000))) {
const authClient = new AuthClient({ ssoDomain: input.value });
await authClient.signIn();
}