SSO Troubleshooting Guide
Common Issues and Solutions
OIDC Issues
"Invalid redirect URI"
Symptoms:
- Error message: "Invalid redirect URI" or "redirect_uri_mismatch"
- User cannot complete SSO login
Solutions:
- Verify the redirect URI in your OIDC provider matches exactly:
https://your-domain.com/auth/callback/oidc?provider_id={provider_id}&tenant_id={tenant_id} - Ensure
provider_idandtenant_idparameters are included - Check for trailing slashes or URL encoding issues
- Verify the domain matches your Lager Guru deployment
"User email not found"
Symptoms:
- Error: "User email not provided by OIDC provider"
- SSO login fails after authentication
Solutions:
- Ensure your OIDC provider returns the
emailclaim in the ID token - Verify the
emailscope is included in your SSO provider configuration - Check your OIDC provider's user attribute mapping
- For Azure AD, ensure "email" is included in token claims
"State parameter mismatch"
Symptoms:
- Error: "Invalid state parameter - possible CSRF attack"
- SSO login fails on callback
Solutions:
- This usually indicates a session timeout or browser issue
- Clear browser cookies and try again
- Ensure cookies are enabled in the browser
- Check if the session storage is being cleared prematurely
"Failed to create OIDC client"
Symptoms:
- Error during SSO initiation
- Cannot connect to OIDC provider
Solutions:
- Verify the issuer URL is correct and accessible
- Check the metadata URL is valid and returns proper JSON
- Ensure network connectivity to the OIDC provider
- Verify SSL certificates are valid
SAML Issues
"SAML response validation failed"
Symptoms:
- Error: "SAML callback handling failed"
- SSO login fails after authentication
Solutions:
- Verify your SAML provider's certificate is valid and not expired
- Check that the metadata URL is accessible and up-to-date
- Ensure the entity ID matches exactly between provider and Lager Guru
- Verify SAML response signatures are valid
- Check SAML provider logs for detailed error messages
"User email not found in SAML response"
Symptoms:
- Error: "User email not found in SAML response"
- SSO login fails
Solutions:
- Verify your SAML provider returns the email attribute
- Check attribute name mapping (see SAML.md for supported attributes)
- Ensure Name ID format includes email address
- For Azure AD SAML, configure "email" in token claims
- Check SAML assertion in browser developer tools (if accessible)
"SAML request ID mismatch"
Symptoms:
- Error: "SAML request ID mismatch - possible replay attack"
- SSO login fails on callback
Solutions:
- This usually indicates a session timeout
- User should retry the SSO login
- Ensure session storage is not being cleared
- Check browser privacy settings
"Failed to fetch SAML metadata"
Symptoms:
- Error during SSO provider configuration
- Cannot load SAML metadata
Solutions:
- Verify the metadata URL is accessible from your network
- Check for CORS issues if accessing from browser
- Ensure the metadata URL returns valid XML
- Try downloading metadata XML and hosting it yourself
General Issues
"SSO provider not found or inactive"
Symptoms:
- Error: "SSO provider not found or inactive"
- SSO login button not working
Solutions:
- Verify the SSO provider is marked as "Active" in System Settings
- Check that the provider belongs to the correct tenant
- Ensure the provider ID matches
- Verify tenant admin permissions
"Tenant ID mismatch"
Symptoms:
- Error: "Tenant ID mismatch"
- SSO login fails
Solutions:
- This is a security feature - users can only access their assigned tenant
- Verify the user belongs to the tenant that initiated SSO
- Check tenant assignment in System Settings
- Contact administrator to verify tenant configuration
"User provisioning failed"
Symptoms:
- Error: "Failed to map SSO user to tenant"
- SSO login fails after authentication
Solutions:
- Verify the user's email is valid and unique
- Check that the tenant exists and is active
- Ensure proper permissions for user creation
- Check database constraints and RLS policies
- Review application logs for detailed error messages
SSO Button Not Showing
Symptoms:
- "Mit Unternehmens-SSO anmelden" button not visible on login page
Solutions:
- Verify at least one SSO provider is configured and active
- Check tenant detection (subdomain routing)
- Ensure proper tenant context
- Verify user has access to SSO-enabled tenant
Debugging Steps
1. Check SSO Provider Configuration
- Go to System Settings → SSO Integration
- Verify provider is active
- Check all required fields are filled
- Test metadata URL accessibility
2. Verify Network Connectivity
- Test access to OIDC metadata URL or SAML metadata URL
- Check firewall rules
- Verify DNS resolution
3. Review Browser Console
- Open browser developer tools (F12)
- Check Console tab for errors
- Check Network tab for failed requests
- Review session storage for SSO state
4. Check Application Logs
- Review server-side logs for detailed error messages
- Check Supabase logs for database errors
- Review authentication flow logs
5. Test with Different Browser
- Try SSO login in incognito/private mode
- Test with different browser
- Clear cookies and cache
Getting Help
If you continue to experience issues:
Collect Information:
- Error messages (exact text)
- Browser console logs
- Network request details
- SSO provider configuration (without secrets)
Contact Support:
- System administrator
- Lager Guru support team
- Your SSO provider's support
Provide Details:
- Steps to reproduce
- Expected vs. actual behavior
- Screenshots if applicable
- Relevant log entries
Best Practices
Test in Staging First:
- Always test SSO configuration in a staging environment
- Verify user provisioning works correctly
- Test with multiple users
Monitor Logs:
- Regularly review authentication logs
- Set up alerts for SSO failures
- Monitor user provisioning
Keep Metadata Updated:
- Regularly refresh SAML metadata
- Update OIDC endpoints if provider changes
- Rotate client secrets periodically
Document Configuration:
- Keep a record of SSO provider settings
- Document any custom attribute mappings
- Maintain a change log
Security Considerations
- Never share client secrets or private keys
- Use HTTPS for all SSO endpoints
- Regularly rotate credentials
- Monitor for suspicious authentication attempts
- Implement proper session management
- Use strong encryption for stored secrets