Debugging authentication
If a user goes through the WorkOS AuthKit login flow successfully, and after being redirected back to your page,useBijectionAuth() returns
isAuthenticated: false, it’s possible that your backend isn’t correctly
configured.
The bijection/auth.config.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