Testing vouch-proxy configuration
Step-by-step guide to test your Identity Provider configuration using the official vouch-proxy Helm chart
This guide provides instructions for testing your Identity Provider (IdP) configuration using the official vouch-proxy Helm chart in an isolated environment before integrating with Patronus AI.
Why test vouch-proxy separately?
Testing vouch-proxy in isolation allows you to:
- Verify your IdP OAuth configuration is correct
- Test SSO authentication flow independently
- Troubleshoot authentication issues without affecting your Patronus deployment
- Validate JWT token structure and claims before configuring role mappings
- Ensure redirect URIs and callback URLs are properly configured
Prerequisites
Before proceeding, ensure you have:
- Kubernetes cluster with kubectl access
- Helm 3.8.0 or above installed
- Identity Provider (IdP) OAuth application configured (see cloud provider-specific guides)
- Basic understanding of OAuth 2.0 and JWT tokens
Step 1: Configure your IdP OAuth application
Before deploying vouch-proxy, ensure your IdP OAuth application is configured with the test callback URL.
Add test callback URL
In your IdP's OAuth application settings, add the vouch-proxy callback URL:
Replace <TEST_DOMAIN> with the domain you'll use for testing (e.g., vouch-test.example.com).
Keep your existing Patronus callback URLs intact. You can have multiple callback URLs configured simultaneously.
Gather OAuth credentials
You'll need the following from your IdP:
- Client ID - OAuth application identifier
- Client Secret - OAuth application secret
- Authorization endpoint - IdP's OAuth authorization URL
- Token endpoint - IdP's token exchange URL
- User info endpoint - IdP's user information endpoint (if applicable)
Step 2: Create vouch-proxy configuration
Create a values.yaml file for vouch-proxy with your IdP configuration.
Basic configuration template
Create a file named vouch-values.yaml:
Generate secrets
Generate random secrets for session and JWT:
Copy these values into your vouch-values.yaml file.
Keep these secrets secure. Never commit them to version control.
Step 3: Deploy vouch-proxy
Deploy vouch-proxy using the official Helm chart.
Add vouch-proxy Helm repository
Create namespace
Deploy vouch-proxy
Verify deployment
Check that vouch-proxy is running:
Expected output:
Check the ingress:
If using cert-manager, wait a few minutes for the TLS certificate to be issued.
Step 4: Test authentication flow
Now test the authentication flow to verify your IdP configuration.
Access the validate endpoint
Navigate to the validate endpoint in your browser:
Expected behavior:
- You should be redirected to your IdP's login page
- After authenticating, you should be redirected back to vouch-proxy
- If successful, you'll see a 200 OKresponse or be redirected to/
Test the login endpoint
You can also test the login endpoint directly:
This will initiate the OAuth flow.
Common test scenarios
Successful authentication:
- Browser redirects to IdP login
- After login, redirects back to vouch-proxy
- Cookie is set in browser
- Subsequent requests to /validatereturn200 OK
Failed authentication:
- Check vouch-proxy logs for error messages
- Verify OAuth credentials are correct
- Ensure callback URL matches IdP configuration
Step 5: Inspect JWT token
After successful authentication, inspect the JWT token to understand its structure for role mapping configuration.
View token information
Navigate to the health endpoint:
This returns vouch-proxy status and configuration.
Extract JWT token from cookie
Use browser developer tools to extract the JWT token:
- Open browser developer tools (F12)
- Go to Application > Cookies
- Find the VouchCookiecookie
- Copy the cookie value
Decode the JWT token
Use JWT.io to decode the token:
- Navigate to https://jwt.io
- Paste the JWT token into the "Encoded" field
- View the decoded payload in the "Decoded" section
Example token payload:
Document token structure
Note the following for role mapping configuration:
- Available claims (email,groups,sub, etc.)
- Claim values that identify users or groups
- Token issuer (issclaim)
- Custom claims specific to your IdP
This token structure will be used when configuring role mappings in Patronus AI's Admin Portal.
Step 6: Check vouch-proxy logs
Review logs to troubleshoot issues or verify successful authentication.
View logs
Common log messages
Successful authentication:
Failed authentication:
Configuration errors:
Step 7: Test specific OAuth scenarios
Perform additional tests to validate edge cases.
Test logout flow
Navigate to the logout endpoint:
This should clear the session and cookie. Subsequent requests to /validate should redirect to login.
Test token expiration
Wait for the JWT maxAge to expire (default 4 hours) and verify that re-authentication is required.
Test multiple users
If testing group-based access, authenticate with different users to verify claim variations.
Step 8: Validate configuration for Patronus integration
Before integrating with Patronus, verify your configuration meets requirements.
Configuration checklist
- Authentication flow completes successfully
-  JWT token contains required claims (emailor unique identifier)
- JWT token structure is documented
- Cookie domain is correctly configured
- TLS/HTTPS is properly configured
- Callback URLs match IdP configuration
- Session and JWT secrets are secure and random
Clean up test deployment
After validation, you can remove the test deployment:
Keep your vouch-values.yaml file as reference for configuring Patronus vouch-proxy settings.
Troubleshooting
Cannot access vouch-proxy
Issue: Unable to reach https://<TEST_DOMAIN>
Solutions:
- Verify DNS resolves to your cluster ingress IP:
- Check ingress controller is running:
- Verify ingress configuration:
- Check TLS certificate status (if using cert-manager):
OAuth authentication fails
Issue: Redirected to IdP but authentication fails
Solutions:
- Verify Client ID and Secret are correct
- Check callback URL matches exactly in IdP configuration
- Ensure scopes are supported by your IdP
- Review vouch-proxy logs for specific error messages:
- Verify OAuth endpoints are correct for your IdP
Cookie not being set
Issue: Authentication completes but cookie is not set
Solutions:
- Verify cookie.domainmatches your test domain
- Ensure cookie.secureistruewhen using HTTPS
- Check browser console for cookie-related errors
- Verify SameSite cookie policies are compatible
State parameter mismatch
Issue: Error message about state parameter mismatch
Solutions:
- Ensure session storage is working properly
- Check that session key is configured
- Verify clock synchronization between vouch-proxy and IdP
- Clear browser cookies and try again
Invalid redirect URI error
Issue: IdP shows "invalid redirect URI" error
Solutions:
- Verify callback URL in vouch-values.yamlmatches IdP configuration exactly
- Ensure use https protocol
- Check for trailing slashes or path differences
- Confirm the OAuth application allows the redirect URI
Next steps
After successfully testing vouch-proxy configuration:
- Accounts and Authentication - Configure authentication in Patronus
- Integrate vouch-proxy configuration into Patronus values.yaml
- Accounts and Authentication - Configure authentication in Patronus
- Configure role mappings based on JWT token structure
- Test end-to-end authentication with Patronus AI
Additional resources
- Vouch Proxy Documentation
- Vouch Proxy Helm Chart
- Vouch Proxy Examples
- JWT.io Token Inspector
- OAuth 2.0 Debugger
