Skip to main content

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.

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