/auth/callback URL. A repeated 401 unauthorized after
the provider screen usually needs an operator to correct the sign-in setup.
Hosted Workspaces uses AuthKit with Google, GitHub, Microsoft, Apple, and email
magic links. A self-hosted instance uses the OIDC provider or Cloudflare Access
chosen by its operator.
Fix common sign-in results
If sign-in succeeds but a workspace is still missing, review personal and
organization workspaces.
Workspace ownership, organization membership, guest links, and visibility
still decide what the account can open.
Check hosted AuthKit
These checks require the hosted Workspaces operator:- Confirm that Google, GitHub, Microsoft, Apple, and email magic links are enabled in the intended AuthKit environment.
- Confirm that the WorkOS client ID and API key belong to the same WorkOS
application and environment. A mismatch can let the provider screen finish
before Workspaces returns
401 unauthorized. Operator logs reportinvalid_clientfor this case. - Register the app origin followed by
/auth/callbackas the redirect URI. Set the sign-in endpoint to the same origin followed by/auth/login. - Set the app homepage and sign-out return to the app origin.
- Keep the session-cookie key stable across deployments. Rotating it signs out existing browsers; those users must sign in again.
Check a self-hosted OIDC login
The instance operator should check these items:- The public app origin is the address the browser uses.
- The identity provider registers that origin followed by
/auth/callback. - The self-host organization ID and name are set.
- The issuer is reachable and serves valid OpenID Connect discovery data. In production, the issuer and every endpoint in that data must use HTTPS.
- The client ID and, for a confidential client, the client secret match the
provider registration. If you set a client secret, the provider must accept
it in the token request form (
client_secret_post). Workspaces does not send it with HTTP Basic authentication. - The ID token contains a subject and email address.
- The Workspaces OIDC session key is at least 32 bytes.
OIDC discovery failed for issuer means the issuer could
not be reached or returned an error. Correct the issuer setting or the server’s
network access. Invalid discovery data or a mismatch between the configured
issuer and the issuer in the discovery data also stops sign-in before the
callback.
Workspaces returns 401 unauthorized for a missing callback code, a changed
state value, a failed token exchange, a wrong issuer or audience, or a missing
subject or email. Start a fresh login after the operator corrects the setup.
If the provider has no logout endpoint, Sign out clears the Workspaces
session but may leave the provider session active.
Check Cloudflare Access
Cloudflare Access handles sign-in before a browser request reaches Workspaces. Workspaces does not create its own login session in this mode. The operator should confirm that:- the Access application covers the app’s custom domain;
- an allow policy includes the person signing in;
- Access sends its assertion with every request to the browser app domain;
- the configured Access team domain and application audience match the assertion; and
- the self-host organization ID and name are set.
401 unauthorized. The Access login flow needs a custom domain; the
default Worker development address does not support this setup. Tools and agents
send Workspaces API keys to the separate public API domain, which must stay
outside Access.
