Appearance
SSO & Login
Login looping, callback error, or access denied after authenticating.
Symptoms
- Login redirects loop endlessly without completing
- "Callback error" or "Invalid redirect URI" after SSO authentication
- "Access denied" even after successful authentication with the provider
- User logs in via SSO but ends up in a different organization or tenant
Diagnosis checklist
- Check that the callback URL registered with your identity provider matches the URL in Runtime Settings
- Check that client ID and client secret are correctly set and haven't expired
- Confirm the user's email domain is allowed in your SSO configuration
- Test in an incognito window (no cached sessions or cookies)
Solutions
Login loop
Cause: the session cookie is not being set correctly.
- Clear cookies for the domain
- Test in incognito
- Check that the app domain is using HTTPS (required for SSO cookies)
- If on a custom domain: verify the SSL certificate is valid
Callback / redirect URI error
Cause: the identity provider rejects the redirect because the URI doesn't match.
- Go to Runtime Settings → Authentication → SSO
- Copy the exact Callback URL shown there
- Add this URL to the allowed redirect URIs in your identity provider (Google, Azure, etc.)
- Save and retry
The callback URL format is: https://[your-app-domain]/auth/callback/[provider]
Access denied after authentication
Cause: the user's email or domain is not in the allowed list.
- Check the Allowed Email Domains setting in Runtime Settings → Authentication → SSO
- If restricting by domain: ensure the user's email domain is listed
- If using groups/roles in the identity provider: ensure the user has the required group
Wrong organization / tenant
- Verify the tenant ID in Azure AD or the workspace in Google Workspace is correct
- Check there are no duplicate SSO configurations pointing to different tenants
Provider-specific notes
Google Workspace
- Authorized domain must match the OAuth consent screen configuration
- "Unverified app" warning: complete Google's app verification process for production
Microsoft Azure AD / Entra ID
- Ensure the Redirect URI is added as "Web" type (not SPA or Mobile)
- Multi-tenant vs single-tenant: check the
tenantparameter in the authorization URL
Generic SAML 2.0
- Verify the Entity ID and ACS URL match between Madrix and the identity provider
- Clock skew between servers can cause SAML assertion failures — ensure server times are synchronized