Authentication Provider Setup Guides
This document provides setup instructions for each supported authentication provider.
Overview
The Greenfield Cluster supports the following authentication providers:
- Azure AD - Microsoft Azure Active Directory (OIDC)
- Google - Google Workspace / Gmail (OIDC)
- GitHub - GitHub Organizations (OAuth2)
- Okta - Okta SAML via Keycloak broker
- Keycloak - Self-hosted identity provider
Quick Setup Matrix
| Provider | Setup Time | Complexity | Group Support | Best For |
|---|---|---|---|---|
| Azure AD | 15 min | Medium | Yes (with config) | Enterprises using Microsoft 365 |
| 10 min | Low | Limited | Startups using Google Workspace | |
| GitHub | 5 min | Very Low | Yes (org/teams) | Developer-focused organizations |
| Okta SAML | 30 min | High | Yes | Enterprises with existing Okta |
| Keycloak | 45 min | Very High | Yes | Full control requirements |
Azure AD Setup
Prerequisites
- Azure AD tenant
- Admin access to create App Registrations
Step-by-Step
-
Create App Registration
-
Note Configuration Values
- Application (client) ID
- Directory (tenant) ID
-
Create a client secret in "Certificates & secrets"
-
Configure Groups (Optional)
-
Deploy to Cluster
-
Update Configuration Edit
kustomize/base/auth/overlays/provider-azuread/configmap.yaml:
Testing
# Check deployment
kubectl get pods -n greenfield -l app=oauth2-proxy
# Test auth flow
curl -I https://myapp.example.com
# Should redirect to login.microsoftonline.com
Common Issues
- Groups not in token: Check API permissions and token configuration
- Redirect loop: Verify redirect URI matches exactly
- Invalid token: Check tenant ID in issuer URL
Google Setup
Prerequisites
- Google Cloud Project
- Google Workspace (for group support)
Step-by-Step
-
Create OAuth Credentials
-
Note Configuration Values
- Client ID (ends with .apps.googleusercontent.com)
-
Client secret
-
Deploy to Cluster
make auth.install PROVIDER=google DOMAIN=example.com # Create secrets kubectl create secret generic oauth2-proxy-secret \ --from-literal=client-id=YOUR_CLIENT_ID.apps.googleusercontent.com \ --from-literal=client-secret=YOUR_CLIENT_SECRET \ --from-literal=cookie-secret=$(openssl rand -base64 32 | head -c 32) \ -n greenfield -
Configure Domain Restriction (Optional)
Testing
# Check deployment
kubectl get pods -n greenfield -l app=oauth2-proxy
# Test auth flow
curl -I https://myapp.example.com
# Should redirect to accounts.google.com
Common Issues
- Domain restriction not working: Check OAUTH2_PROXY_GOOGLE_GROUP environment variable
- Groups not supported: Google OIDC doesn't provide groups; use domain restriction or service account
GitHub Setup
Prerequisites
- GitHub Organization (for team support)
- Admin access to create OAuth Apps
Step-by-Step
-
Create OAuth App
-
Note Configuration Values
- Client ID
-
Client secret
-
Deploy to Cluster
-
Configure Organization/Team (Optional) Edit
kustomize/base/auth/overlays/provider-github/configmap.yaml:
Testing
# Check deployment
kubectl get pods -n greenfield -l app=oauth2-proxy
# Test auth flow
curl -I https://myapp.example.com
# Should redirect to github.com/login/oauth
Common Issues
- Organization restriction not working: Check OAUTH2_PROXY_GITHUB_ORG environment variable
- Team access denied: Ensure user is member of specified team
- Private org members: User must authorize OAuth app to access private membership
Okta SAML Setup
Prerequisites
- Okta account with admin access
- PostgreSQL database (included in greenfield cluster)
Architecture
This setup uses Keycloak as a broker to convert Okta SAML to OIDC.
Step-by-Step
-
Deploy Keycloak
-
Create Secrets
# Keycloak admin kubectl create secret generic keycloak-admin-secret \ --from-literal=password=$(openssl rand -base64 32) \ -n greenfield # Keycloak database kubectl create secret generic keycloak-db-secret \ --from-literal=username=keycloak \ --from-literal=password=$(openssl rand -base64 32) \ -n greenfield # oauth2-proxy (client secret will be set later from Keycloak) kubectl create secret generic oauth2-proxy-secret \ --from-literal=client-id=oauth2-proxy \ --from-literal=client-secret=TEMPORARY \ --from-literal=cookie-secret=$(openssl rand -base64 32 | head -c 32) \ -n greenfield -
Configure Okta SAML App
Okta → Applications → Create App Integration - Sign-in method: SAML 2.0 - App name: Keycloak - Single sign on URL: https://keycloak.example.com/auth/realms/master/broker/okta/endpoint - Audience URI: https://keycloak.example.com/auth/realms/master Attribute Statements: - email → user.email - firstName → user.firstName - lastName → user.lastName - groups → user.groups (if group support needed) -
Configure Keycloak
# Access Keycloak admin kubectl port-forward -n greenfield svc/keycloak 8080:8080 # Open http://localhost:8080/auth # In Keycloak: # 1. Add Identity Provider (SAML v2.0) # - Alias: okta # - Service Provider Entity ID: https://keycloak.example.com/auth/realms/master # - Single Sign-On Service URL: (from Okta) # - Upload Okta signing certificate # # 2. Create OIDC Client # - Client ID: oauth2-proxy # - Access Type: confidential # - Valid Redirect URIs: https://auth.example.com/oauth2/callback # - Copy client secret # # 3. Configure Mappers # - Add group membership mapper # - Add SAML attribute mappers -
Update oauth2-proxy Secret
Testing
# Check deployments
kubectl get pods -n greenfield -l app=keycloak
kubectl get pods -n greenfield -l app=oauth2-proxy
# Test auth flow
curl -I https://myapp.example.com
# Should redirect to Keycloak, which redirects to Okta
Common Issues
- SAML assertion failed: Check certificate, SSO URL, Entity ID
- Groups not in token: Configure SAML attribute mapper and group mapper
- Redirect loop: Verify all URLs match (Okta, Keycloak, oauth2-proxy)
Keycloak as Primary IdP
Prerequisites
- PostgreSQL database (included in greenfield cluster)
Step-by-Step
-
Deploy Keycloak
-
Create Secrets
-
Access Admin Console
-
Configure Realms and Clients
- Create application-specific realms
- Configure OIDC clients
- Set up user federation (LDAP, AD)
- Configure identity brokering
Testing
# Check deployment
kubectl get pods -n greenfield -l app=keycloak
# Test realm availability
curl https://keycloak.example.com/auth/realms/master/.well-known/openid-configuration
Next Steps
After provider setup:
-
Protect an Application
-
Verify Configuration
-
Review Documentation
- Architecture
- Troubleshooting
- App Templates