Files
keycloak-pattern/keycloak/import/keycloak-patterns-realm.json

181 lines
5.1 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"
}
]
},
"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/*"
},
"protocolMappers": [
{
"name": "keycloak-pattern-api-audience",
"protocol": "openid-connect",
"protocolMapper": "oidc-audience-mapper",
"consentRequired": false,
"config": {
"included.custom.audience": "keycloak-pattern-api",
"id.token.claim": "false",
"access.token.claim": "true",
"userinfo.token.claim": "false",
"introspection.token.claim": "true"
}
}
]
},
{
"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:4180/oauth2/callback"
],
"webOrigins": [],
"attributes": {
"post.logout.redirect.uris": "http://localhost:8088/*"
}
}
],
"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
}
]
}
]
}