Repository navigation
Conversation
El constructor declaraba `scope` pero nunca asignaba `config.scope`, así que cada /authorize pedía `openid profile email` dijera lo que dijera la app. Con el `audience` de una Api con RBAC el access token salía con `permissions` vacío: auth concede los scopes pedidos ∩ catálogo ∩ roles, y no se pedía ninguno (visto en el admin de reservas de Kirbic). signIn, signInWithOauthConnection, linkOauthConnection y getTokenSilently ya caían en `_scope()`; ahora llega el configurado. buildAuthorizeUrl (y con él authorize y stepUp) también lo usa cuando la llamada no pasa uno; sin scope configurado sigue sin mandar ninguno. El `scopes`/`scope` de cada llamada manda sobre el configurado. La doc decía que el defecto era `profile email` con `openid` siempre añadido: es `openid profile email`, y un scope propio lo sustituye entero. Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qué pasaba
FaableAuthClientdeclarascopey_scope()devuelvethis.scope || 'openid profile email', pero el constructor nunca asignabaconfig.scope. Cada/authorizepedíaopenid profile email. Con elaudiencede una Api con RBAC, el access token salía conpermissionsvacío, porque auth concede los scopes pedidos ∩ catálogo ∩ roles (computePermissionsClaim). Se vio en el admin de reservas de Kirbic.Cambios
this.scope = config.scope.buildAuthorizeUrl(y con élauthorizeystepUp):scope: options.scope || this.scope. Sin scope configurado sigue sin mandar ninguno, como hasta ahora.signIn,signInWithOauthConnection,linkOauthConnectionygetTokenSilentlyya pasaban por_scope(), así que ahora reciben el scope configurado. Elscopesde cada llamada sigue mandando sobre él.AuthorizationParams.scopedecía que el defecto eraprofile emaily queopenidse añadía siempre. En realidad el defecto esopenid profile email, y un scope propio lo sustituye entero. Se ha ampliado también la doc deFaableAuthClientConfig.scope.Pruebas
Nuevo
tests/unit/configScope.test.ts. Usa la URL de authorize que devuelvensignInysignInWithOauthConnectionconskipBrowserRedirect, además debuildAuthorizeUrl.main: 3 de 6 fallan (Received: "openid profile email").lint,format:check,buildytest:pack. El e2e lo corre el CI.Co-Authored-By: Claude noreply@anthropic.com