From 699854e76b6f44e4c5ee28681e7c2194ff7f361a Mon Sep 17 00:00:00 2001 From: Lebaud Antoine Date: Wed, 14 Feb 2024 22:35:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(project)=20configure=20standard=20?= =?UTF-8?q?OIDC=20flow=20in=20Keycloak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enforce Authorization Code flow, and disable Implicit flow. Done: - Rename client people-front to people - Add a client secret shared with the backend - Add allowed redirect uris - Disable implicit flow and enable Authorization Code flow without PCKE - Sign userinfo endpoint to return application/jwt content --- docker/auth/realm.json | 44 ++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/docker/auth/realm.json b/docker/auth/realm.json index 95b05ca..295ae2c 100644 --- a/docker/auth/realm.json +++ b/docker/auth/realm.json @@ -335,7 +335,6 @@ ], "security-admin-console": [], "admin-cli": [], - "people-front": [], "account-console": [], "broker": [ { @@ -348,6 +347,7 @@ "attributes": {} } ], + "people": [], "account": [ { "id": "63b1a4e1-a594-4571-99c3-7c5c3efd61ce", @@ -602,7 +602,9 @@ "publicClient": true, "frontchannelLogout": false, "protocol": "openid-connect", - "attributes": {}, + "attributes": { + "post.logout.redirect.uris": "+" + }, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": false, "nodeReRegistrationTimeout": 0, @@ -640,7 +642,9 @@ "publicClient": false, "frontchannelLogout": false, "protocol": "openid-connect", - "attributes": {}, + "attributes": { + "post.logout.redirect.uris": "+" + }, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": false, "nodeReRegistrationTimeout": 0, @@ -660,7 +664,7 @@ }, { "id": "869481d0-5774-4e64-bc30-fedc7c58958f", - "clientId": "people-front", + "clientId": "people", "name": "", "description": "", "rootUrl": "", @@ -670,9 +674,10 @@ "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", + "secret": "ThisIsAnExampleKeyForDevPurposeOnly", "redirectUris": [ - "", "http://localhost:8070/*", + "http://localhost:8071/*", "http://localhost:3200/*", "http://localhost:8088/*", "http://localhost:3000/*" @@ -688,18 +693,29 @@ "consentRequired": false, "standardFlowEnabled": true, "implicitFlowEnabled": false, - "directAccessGrantsEnabled": true, + "directAccessGrantsEnabled": false, "serviceAccountsEnabled": false, - "publicClient": true, + "publicClient": false, "frontchannelLogout": true, "protocol": "openid-connect", "attributes": { + "access.token.lifespan": "-1", + "client.secret.creation.time": "1707820779", + "user.info.response.signature.alg": "RS256", + "post.logout.redirect.uris": "http://localhost:8070/*##http://localhost:3200/*##http://localhost:3000/*", + "oauth2.device.authorization.grant.enabled": "false", + "use.jwks.url": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "use.refresh.tokens": "true", + "tls-client-certificate-bound-access-tokens": "false", "oidc.ciba.grant.enabled": "false", "backchannel.logout.session.required": "true", - "post.logout.redirect.uris": "http://localhost:8070/*##http://localhost:3200/*##http://localhost:3000/*", + "client_credentials.use_refresh_token": "false", + "acr.loa.map": "{}", + "require.pushed.authorization.requests": "false", "display.on.consent.screen": "false", - "oauth2.device.authorization.grant.enabled": "false", - "backchannel.logout.revoke.offline.tokens": "false" + "client.session.idle.timeout": "-1", + "token.response.type.bearer.lower-case": "false" }, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": true, @@ -738,7 +754,9 @@ "publicClient": false, "frontchannelLogout": false, "protocol": "openid-connect", - "attributes": {}, + "attributes": { + "post.logout.redirect.uris": "+" + }, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": false, "nodeReRegistrationTimeout": 0, @@ -909,7 +927,8 @@ "consentRequired": false, "config": { "id.token.claim": "true", - "access.token.claim": "true" + "access.token.claim": "true", + "userinfo.token.claim": "true" } } ] @@ -1229,6 +1248,7 @@ "consentRequired": false, "config": { "multivalued": "true", + "userinfo.token.claim": "true", "user.attribute": "foo", "id.token.claim": "true", "access.token.claim": "true",