From 5ca7e6acb3aaeb26d7da3f00623b06435813437a Mon Sep 17 00:00:00 2001 From: deploy Date: Sun, 4 Oct 2026 22:12:19 +0000 Subject: [PATCH] molde(realm): tenant novo nasce com o client app (PKCE) do treinador --- moldes/realm-do-tenant.LEIA-ME.md | 7 ++++++ moldes/realm-do-tenant.json | 40 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/moldes/realm-do-tenant.LEIA-ME.md b/moldes/realm-do-tenant.LEIA-ME.md index b0a448e..07d2d03 100644 --- a/moldes/realm-do-tenant.LEIA-ME.md +++ b/moldes/realm-do-tenant.LEIA-ME.md @@ -14,6 +14,13 @@ SAO COISAS DIFERENTES desde aquela decisao. O realm e numerado porque uma instancia so de Keycloak nao comporta quatro realms chamados `athleticmap`; o subdominio e o nome que o cliente ve. +── CLIENTES ──────────────────────────────────────────────────────────────── + + `spa` — tela web do tenant (redirect HTTPS do subdominio). + `app` — app mobile (PKCE; redirect `com.athleticmap.app:/oauthredirect` e + `https://{{TENANT}}.athleticmap.com/app/callback`). Sem ROPC. + Tenants ja provisionados: `scripts/client_app_mobile.py --aplicar`. + ── O DOMINIO DOS REDIRECTS ───────────────────────────────────────────────── `athleticmap.com`, e nao `athleticmap.influxdigital.com.br` — o canonico foi diff --git a/moldes/realm-do-tenant.json b/moldes/realm-do-tenant.json index 189260b..570d37b 100644 --- a/moldes/realm-do-tenant.json +++ b/moldes/realm-do-tenant.json @@ -71,6 +71,46 @@ } } ] + }, + { + "clientId": "app", + "name": "Athletic Map App (mobile)", + "publicClient": true, + "protocol": "openid-connect", + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "redirectUris": [ + "com.athleticmap.app:/oauthredirect", + "http://127.0.0.1:8765/oauthredirect", + "http://localhost:8765/oauthredirect", + "https://{{TENANT}}.athleticmap.com/app/callback" + ], + "webOrigins": [ + "https://{{TENANT}}.athleticmap.com", + "http://127.0.0.1:8765", + "http://localhost:8765" + ], + "attributes": { + "pkce.code.challenge.method": "S256", + "post.logout.redirect.uris": "com.athleticmap.app:/oauthredirect##http://127.0.0.1:8765/oauthredirect##http://localhost:8765/oauthredirect##https://{{TENANT}}.athleticmap.com/app/callback" + }, + "protocolMappers": [ + { + "name": "funcionario_id", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "funcionario_id", + "claim.name": "funcionario_id", + "jsonType.label": "String", + "id.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + } + ] } ], "attributes": {