@uniora/auth0
v1.1.0
Published
Auth0 adapter for @uniora/core: turns an Auth0 access token into an Identity
Maintainers
Readme
@uniora/auth0
Auth0 identity adapter for UNIORA. It only answers "who is this?": it returns an Identity ({ provider, subject }), or null for anything it can't verify, and never throws into an access decision. What that identity may do is always decided by the AuthorizationEngine in @uniora/core.
npm install @uniora/core @uniora/auth0import { resolveIdentity, toVerifiedEmail } from "@uniora/auth0";
const identity = await resolveIdentity(verifyAccessToken, accessToken); // Identity | nulltoVerifiedEmail returns the address the provider has verified, or null. Pass it as verifiedEmail to invitations.accept(...) (never an address the user merely typed).
toProfile(user) returns { displayName, email, avatarUrl } (display data only, the avatar is just a URL) and resolveIdentityWithProfile(...) verifies once and returns { identity, profile }: pass them to createProfileSync(storage) from @uniora/core so Studio shows the person, not an id. See Identity adapters.
The adapter defines a minimal structural contract for your already-configured client, so it adds no dependency on the provider's SDK.
Documentation: Identity adapters guide and the full index.
License: Apache-2.0.
