273 lines
8.0 KiB
JSON
273 lines
8.0 KiB
JSON
{
|
|
"realm": "keycloak-patterns",
|
|
"displayName": "Keycloak Authentication Patterns",
|
|
"enabled": true,
|
|
"sslRequired": "external",
|
|
"registrationAllowed": false,
|
|
"resetPasswordAllowed": false,
|
|
"editUsernameAllowed": false,
|
|
"loginWithEmailAllowed": true,
|
|
"duplicateEmailsAllowed": false,
|
|
"bruteForceProtected": true,
|
|
"accessTokenLifespan": 300,
|
|
"ssoSessionIdleTimeout": 1800,
|
|
"ssoSessionMaxLifespan": 36000,
|
|
"offlineSessionIdleTimeout": 2592000,
|
|
"revokeRefreshToken": true,
|
|
"refreshTokenMaxReuse": 0,
|
|
"roles": {
|
|
"realm": [
|
|
{
|
|
"name": "admin-role",
|
|
"description": "Administrative role used by authorization examples"
|
|
},
|
|
{
|
|
"name": "user-role",
|
|
"description": "Regular authenticated user role"
|
|
},
|
|
{
|
|
"name": "employee-role",
|
|
"description": "Assigned to brokered identities whose hosted-domain claim is example.test"
|
|
}
|
|
]
|
|
},
|
|
"clients": [
|
|
{
|
|
"clientId": "spa-public",
|
|
"name": "AP1 SPA Public Client",
|
|
"description": "Browser-based OAuth client using Authorization Code and PKCE",
|
|
"enabled": true,
|
|
"protocol": "openid-connect",
|
|
"publicClient": true,
|
|
"standardFlowEnabled": true,
|
|
"implicitFlowEnabled": false,
|
|
"directAccessGrantsEnabled": false,
|
|
"serviceAccountsEnabled": false,
|
|
"frontchannelLogout": true,
|
|
"redirectUris": [
|
|
"http://localhost:8088/*",
|
|
"http://127.0.0.1:8088/*"
|
|
],
|
|
"webOrigins": [
|
|
"http://localhost:8088",
|
|
"http://127.0.0.1:8088"
|
|
],
|
|
"attributes": {
|
|
"pkce.code.challenge.method": "S256",
|
|
"post.logout.redirect.uris": "http://localhost:8088/*##http://127.0.0.1:8088/*"
|
|
}
|
|
},
|
|
{
|
|
"clientId": "token-mediating-confidential",
|
|
"name": "AP2 Token-Mediating Backend",
|
|
"description": "Confidential backend that keeps refresh tokens server-side",
|
|
"enabled": true,
|
|
"protocol": "openid-connect",
|
|
"publicClient": false,
|
|
"clientAuthenticatorType": "client-secret",
|
|
"secret": "${TOKEN_MEDIATING_CLIENT_SECRET}",
|
|
"standardFlowEnabled": true,
|
|
"implicitFlowEnabled": false,
|
|
"directAccessGrantsEnabled": false,
|
|
"serviceAccountsEnabled": false,
|
|
"frontchannelLogout": true,
|
|
"redirectUris": [
|
|
"http://localhost:8082/login/oauth2/code/keycloak"
|
|
],
|
|
"webOrigins": [
|
|
"http://localhost:8082"
|
|
],
|
|
"attributes": {
|
|
"post.logout.redirect.uris": "http://localhost:8082/*"
|
|
}
|
|
},
|
|
{
|
|
"clientId": "bff-confidential",
|
|
"name": "AP3 Backend-for-Frontend",
|
|
"description": "Confidential BFF that keeps all OAuth tokens server-side",
|
|
"enabled": true,
|
|
"protocol": "openid-connect",
|
|
"publicClient": false,
|
|
"clientAuthenticatorType": "client-secret",
|
|
"secret": "${BFF_CLIENT_SECRET}",
|
|
"standardFlowEnabled": true,
|
|
"implicitFlowEnabled": false,
|
|
"directAccessGrantsEnabled": false,
|
|
"serviceAccountsEnabled": false,
|
|
"frontchannelLogout": true,
|
|
"redirectUris": [
|
|
"http://localhost:8083/login/oauth2/code/keycloak"
|
|
],
|
|
"webOrigins": [
|
|
"http://localhost:8083"
|
|
],
|
|
"attributes": {
|
|
"post.logout.redirect.uris": "http://localhost:8083/*"
|
|
}
|
|
},
|
|
{
|
|
"clientId": "edge-proxy",
|
|
"name": "AP4 Edge Forward Auth",
|
|
"description": "Confidential oauth2-proxy OIDC client",
|
|
"enabled": true,
|
|
"protocol": "openid-connect",
|
|
"publicClient": false,
|
|
"clientAuthenticatorType": "client-secret",
|
|
"secret": "${EDGE_PROXY_CLIENT_SECRET}",
|
|
"standardFlowEnabled": true,
|
|
"implicitFlowEnabled": false,
|
|
"directAccessGrantsEnabled": false,
|
|
"serviceAccountsEnabled": false,
|
|
"frontchannelLogout": true,
|
|
"redirectUris": [
|
|
"http://localhost:8088/oauth2/callback"
|
|
],
|
|
"webOrigins": [],
|
|
"attributes": {
|
|
"pkce.code.challenge.method": "S256",
|
|
"post.logout.redirect.uris": "http://localhost:8088/*"
|
|
}
|
|
}
|
|
],
|
|
"identityProviders": [
|
|
{
|
|
"alias": "mock-google",
|
|
"displayName": "Mock Google (local verification)",
|
|
"providerId": "oidc",
|
|
"enabled": true,
|
|
"updateProfileFirstLoginMode": "off",
|
|
"trustEmail": false,
|
|
"storeToken": false,
|
|
"addReadTokenRoleOnCreate": false,
|
|
"authenticateByDefault": false,
|
|
"linkOnly": false,
|
|
"firstBrokerLoginFlowAlias": "first broker login",
|
|
"config": {
|
|
"clientId": "mock-google-broker",
|
|
"clientSecret": "${MOCK_GOOGLE_BROKER_CLIENT_SECRET}",
|
|
"authorizationUrl": "http://localhost:8080/realms/mock-google/protocol/openid-connect/auth",
|
|
"tokenUrl": "http://keycloak:8080/realms/mock-google/protocol/openid-connect/token",
|
|
"userInfoUrl": "http://keycloak:8080/realms/mock-google/protocol/openid-connect/userinfo",
|
|
"issuer": "http://localhost:8080/realms/mock-google",
|
|
"jwksUrl": "http://keycloak:8080/realms/mock-google/protocol/openid-connect/certs",
|
|
"useJwksUrl": "true",
|
|
"validateSignature": "true",
|
|
"defaultScope": "openid profile email",
|
|
"syncMode": "IMPORT",
|
|
"pkceEnabled": "true",
|
|
"pkceMethod": "S256"
|
|
}
|
|
}
|
|
],
|
|
"identityProviderMappers": [
|
|
{
|
|
"name": "mock-google-stable-username",
|
|
"identityProviderAlias": "mock-google",
|
|
"identityProviderMapper": "oidc-username-idp-mapper",
|
|
"config": {
|
|
"template": "${ALIAS}.${CLAIM.sub}",
|
|
"target": "LOCAL"
|
|
}
|
|
},
|
|
{
|
|
"name": "mock-google-email",
|
|
"identityProviderAlias": "mock-google",
|
|
"identityProviderMapper": "oidc-user-attribute-idp-mapper",
|
|
"config": {
|
|
"syncMode": "INHERIT",
|
|
"claim": "email",
|
|
"user.attribute": "email"
|
|
}
|
|
},
|
|
{
|
|
"name": "mock-google-given-name",
|
|
"identityProviderAlias": "mock-google",
|
|
"identityProviderMapper": "oidc-user-attribute-idp-mapper",
|
|
"config": {
|
|
"syncMode": "INHERIT",
|
|
"claim": "given_name",
|
|
"user.attribute": "firstName"
|
|
}
|
|
},
|
|
{
|
|
"name": "mock-google-family-name",
|
|
"identityProviderAlias": "mock-google",
|
|
"identityProviderMapper": "oidc-user-attribute-idp-mapper",
|
|
"config": {
|
|
"syncMode": "INHERIT",
|
|
"claim": "family_name",
|
|
"user.attribute": "lastName"
|
|
}
|
|
},
|
|
{
|
|
"name": "mock-google-picture",
|
|
"identityProviderAlias": "mock-google",
|
|
"identityProviderMapper": "oidc-user-attribute-idp-mapper",
|
|
"config": {
|
|
"syncMode": "INHERIT",
|
|
"claim": "picture",
|
|
"user.attribute": "picture"
|
|
}
|
|
},
|
|
{
|
|
"name": "mock-google-hosted-domain",
|
|
"identityProviderAlias": "mock-google",
|
|
"identityProviderMapper": "oidc-user-attribute-idp-mapper",
|
|
"config": {
|
|
"syncMode": "INHERIT",
|
|
"claim": "hd",
|
|
"user.attribute": "hd"
|
|
}
|
|
},
|
|
{
|
|
"name": "mock-google-example-domain-role",
|
|
"identityProviderAlias": "mock-google",
|
|
"identityProviderMapper": "oidc-role-idp-mapper",
|
|
"config": {
|
|
"syncMode": "INHERIT",
|
|
"claim": "hd",
|
|
"claim.value": "example.test",
|
|
"role": "employee-role"
|
|
}
|
|
}
|
|
],
|
|
"users": [
|
|
{
|
|
"username": "admin-user",
|
|
"enabled": true,
|
|
"email": "admin-user@example.test",
|
|
"emailVerified": true,
|
|
"firstName": "Admin",
|
|
"lastName": "User",
|
|
"realmRoles": [
|
|
"admin-role"
|
|
],
|
|
"credentials": [
|
|
{
|
|
"type": "password",
|
|
"value": "${ADMIN_USER_PASSWORD}",
|
|
"temporary": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"username": "regular-user",
|
|
"enabled": true,
|
|
"email": "regular-user@example.test",
|
|
"emailVerified": true,
|
|
"firstName": "Regular",
|
|
"lastName": "User",
|
|
"realmRoles": [
|
|
"user-role"
|
|
],
|
|
"credentials": [
|
|
{
|
|
"type": "password",
|
|
"value": "${REGULAR_USER_PASSWORD}",
|
|
"temporary": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|