browser -> Gate One -> Keycloak -> GoogleKeycloak with Google
This example uses Keycloak as the IAM and OIDC issuer, with Google as an additional identity provider inside Keycloak. Gate One only sees the Keycloak issuer; it does not configure Google directly.
File
{
"authProvider": {
"type": "oidc",
"issuer": "https://auth.example.com/realms/company",
"clientId": "gate-one",
"clientSecretEnv": "OIDC_CLIENT_SECRET",
"loginBaseUrl": "https://login.example.com",
"cookieDomain": "example.com",
"roleClaims": ["realm_access.roles", "groups"]
},
"routes": [{
"host": "app.example.com", "path": "/*", "frontend": true,
"backend": "http://app:8080", "auth": {}
}]
}Keycloak setup
Create the realm
company.Create an OIDC client
gate-one:Valid redirect URIs:
https://login.example.com/auth/callback;Valid post logout redirect URIs:
https://app.example.com/*— one entry per application host (the host Gate One sends aspost_logout_redirect_uri).
Add an Identity Provider of type Google and enter the Google client ID/secret. Complete the Google OAuth consent configuration.
Add a mapper/claim so Keycloak roles or groups appear in the token (
realm_access.rolesis included by default;groupsrequires a group-membership mapper).Optionally add a role mapper to expose application roles as
roles.
Gate One does not need the Google client ID or secret. Those stay in Keycloak.
Important | Register a post logout redirect URI for every application host.
Gate One’s logout sends the originating application as
|
Run it
export OIDC_CLIENT_SECRET=...
gate-one -check -config routes.json
gate-one -config routes.jsonRegister https://login.example.com/auth/callback as the Keycloak
client redirect URI, and https://app.example.com/* as a valid
post logout redirect URI. Point app.example.com,
login.example.com and auth.example.com at the right hosts.
What to observe
Gate One redirects to Keycloak, and Keycloak offers Google (or another configured IdP) on its login page.
The Gate One session is created from the Keycloak issuer, not from Google.
roleClaimsmaps Keycloak roles/groups into Gate One’s route policy.
Note |
|
Next
See Multiple identity providers for the pattern and the embedded alternative.