Hierarchy
-
Auth↳MutationAuth
Methods
getUserIdentity
▸ getUserIdentity():Promise<UserIdentity | null>
Get details about the currently authenticated user.
Returns
Promise<UserIdentity | null>
A promise that resolves to a UserIdentity if the Bijection
client was configured with a valid ID token, or if not, will:
- returns
nullon Bijection queries, mutations, actions. throwon HTTP Actions.
Inherited from
Auth.getUserIdentitysignJwt
▸ signJwt(options): Promise<string>
Sign an ES256 JWT with this deployment’s key.
Pass the claims and expiresInSeconds values that match your use case.
Bijection populates the header and sets the iss, iat and exp claims.
The iss is process.env.BIJECTION_CLOUD_URL for the app and
${process.env.BIJECTION_CLOUD_URL}/components/<name> for a component.
Anyone can verify these tokens against the public keys at
${process.env.BIJECTION_CLOUD_URL}/.well-known/jwks.json.
Claims are signed but not encrypted, so anyone holding the token can read
them.
Prefer short token lifetimes: a token can’t be revoked individually, and a
mutation can always sign a fresh one to reassert the claims. This API
allows a token to have a max expiration of 1 hour from issuance.
Claims that start with bijection or cvx (case insensitive) and the nbf
claim are reserved and may not be set.
Parameters
Returns
Promise<string>