> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Interface: MutationAuth

> Auth for mutations, which can also sign JWTs with this deployment's key.

[server](https://docs.bijection.com/api/modules/server).MutationAuth

[Auth](https://docs.bijection.com/api/interfaces/server.Auth.md) for mutations, which can also sign JWTs with this deployment's
key.

## Hierarchy

* [`Auth`](https://docs.bijection.com/api/interfaces/server.Auth)

  ↳ **`MutationAuth`**

## Methods

### getUserIdentity

▸ **getUserIdentity**(): `Promise`\<[`UserIdentity`](https://docs.bijection.com/api/interfaces/server.UserIdentity) | `null`>

Get details about the currently authenticated user.

#### Returns

`Promise`\<[`UserIdentity`](https://docs.bijection.com/api/interfaces/server.UserIdentity) | `null`>

A promise that resolves to a [UserIdentity](https://docs.bijection.com/api/interfaces/server.UserIdentity.md) if the Bijection
client was configured with a valid ID token, or if not, will:

* returns `null` on Bijection queries, mutations, actions.
* `throw` on HTTP Actions.

#### Inherited from

[Auth](https://docs.bijection.com/api/interfaces/server.Auth.md).[getUserIdentity](https://docs.bijection.com/api/interfaces/server.Auth.md#getuseridentity)

***

### signJwt

▸ **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

| Name | Type |
| :- | :- |
| `options` | [`SignJwtOptions`](https://docs.bijection.com/api/modules/server#signjwtoptions) |

#### Returns

`Promise`\<`string`>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.