You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AS: remembered consent skips the Data Custodian delegation, so the token has no ESPI provisioning or URIs #276
When the Authorization Server already holds the customer's consent for a Third Party, a repeat authorization skips the Data Custodian completely. The Third Party then gets a token with no ESPI provisioning and no token-response URIs.
Found while testing #146 / #275 end to end (local profile): the first Authorize Monthly returned resourceURI and authorizationURI. A second authorization by the same customer in the same browser session returned a token with none of the ESPI keys. Restarting the AS (in-memory consent store) brought the URIs back.
Cause (from the code, to be confirmed with a test)
AuthorizeContinueController saves the customer's approved scope in the OAuth2AuthorizationConsentService (JDBC) so that the replayed /oauth2/authorize passes Spring's consent check.
That consent is persisted and never removed.
On the next /oauth2/authorize for the same client, customer and scope, Spring Authorization Server finds the stored consent. It does not redirect to the consent page (/authorize/delegate) and mints the code directly.
No delegation means no GrantContext in the session. GrantContextEnrichingAuthorizationService stamps nothing, so the token customizer provisions no ESPI Authorization or Subscription, and the token response carries no resourceURI, authorizationURI or customerResourceURI.
Effects
The Third Party receives a customer access token that points at no Subscription (REQ.21 6.1.2 requires the URIs).
The customer never sees the DC's Authorization Screen for the new authorization, so no per-Function-Block or UsagePoint choice is made, and the DC has no record of it.
Fix
Every ESPI customer authorization must go through the DC delegation. Options:
Remove the consent record once the replayed /oauth2/authorize has minted the code, so it is used once only.
Or don't use Spring's consent store for this: let the continue step mark the request as approved for that single replay.
Check how this interacts with re-authorization, revocation and refresh (#202).
Tests
testcontainers-it: authorize twice for the same customer and client. The second run must redirect to /authorize/delegate, provision a new Subscription and return the URIs.
Activity