> ## 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.

# Bijection & Auth0

Configure the Bijection deployment to verify tokens from Auth0. Set the
issuer and audience for the application token in
[`bijection/sign-in.ts`](https://docs.bijection.com/reference/configuration/auth-config).
[OIDC providers](https://docs.bijection.com/access/authentication/custom-oidc.md) describes the
configuration fields.

Use Auth0's client library to sign in and obtain the application token.
The SDK ships no Auth0 adapter, so give the client a `ClientAuth` that reads
it:

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { connect, type ClientAuth } from "@bijectionhq/bijection/client";
import type App from "../bijection/app";

const listeners = new Set<() => void>();
const auth: ClientAuth = {
  token: async ({ refresh }) =>
    (await auth0.isAuthenticated()) ? await auth0.getTokenSilently({ cacheMode: refresh ? "off" : "on" }) : null,
  subscribe: (changed) => {
    listeners.add(changed);
    return () => listeners.delete(changed);
  },
};
export const client = connect(url, { contract: "discover", token: auth });
// On principal, session, or audience changes, notify before yielding:
// for (const changed of listeners) changed();
```

In a server request, create a client with that user's token:
`connect(url, { contract: "discover", token })`.

For access to protected application data, give the verified subject the
[roles your app requires](https://docs.bijection.com/access/grants.md). Use the
[verified principal](https://docs.bijection.com/access/authentication/functions.md), `ctx.frame.as`, for attribution.


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