Debugging authentication
If AuthKit signs the user in but the deployment sees an anonymous caller, check thatconnect(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:
- Incorrect Client ID: Ensure the
WORKOS_CLIENT_IDin your Bijection environment matches your WorkOS application - Missing Environment Variables: Verify all required WorkOS environment variables are set in both your local environment and Bijection console
- Redirect URI Mismatch: Ensure the
NEXT_PUBLIC_WORKOS_REDIRECT_URImatches what’s configured in your WorkOS Dashboard - Missing
audclaim: WorkOS JWTs may not include theaud(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
Access revoked
Ifbijection 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.
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.