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

# AuthKit Troubleshooting

## Debugging authentication

If AuthKit signs the user in but the deployment sees an anonymous caller,
check that `connect(url, { token: auth })` and
`useClientAuth(auth, useAuth())` use the same adapter. Check that
`AuthKitProvider` passes the token to that adapter with
`onRefresh={auth.onRefresh}`. Compare the token's issuer and audience with
the installation's configuration.

The `bijection/sign-in.ts` file contains a list of configured authentication
providers. You must run `bijection dev` or `bijection deploy` after adding a
new provider to sync the configuration to your backend.

Common issues with WorkOS AuthKit integration:

1. **Incorrect Client ID**: Ensure the `WORKOS_CLIENT_ID` in your Bijection
   environment matches your WorkOS application
2. **Missing Environment Variables**: Verify all required WorkOS environment
   variables are set in both your local environment and Bijection console
3. **Redirect URI Mismatch**: Ensure the `NEXT_PUBLIC_WORKOS_REDIRECT_URI`
   matches what's configured in your WorkOS Dashboard
4. **Missing `aud` claim**: WorkOS JWTs may not include the `aud` (audience)
   claim by default, which Bijection requires for token validation. Check your
   WorkOS Dashboard JWT configuration to ensure the audience claim is properly
   set to your Client ID

For more thorough debugging steps, see the WorkOS AuthKit documentation or
[Debugging Authentication](https://docs.bijection.com/access/authentication/troubleshooting.md).

## Access revoked

If `bijection dev` or `bijection deploy` reports `WorkOSAccessRevoked`,
a WorkOS team administrator has withdrawn the management service's access.
Ask WorkOS support to restore that access, or
[configure an existing WorkOS environment](https://docs.bijection.com/access/authentication/providers/authkit#option-2-use-an-existing-workos-team).

To create a managed WorkOS team, start `bijection dev` in an interactive
terminal after provisioning the WorkOS environment. Sign in as a Bijection team Admin
whose verified email does not already administer a WorkOS team.


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