Skip to content

Addressing #6 - public client: token_endpoint_auth_method should be none (AuthorizationCodeGrant top-level redirect prompt=none) - #7

Closed
uvdsl wants to merge 9 commits into
mainfrom
best_practice/token_endpoint_auth_method_none
Closed

uvdsl wants to merge 9 commits into
mainfrom
best_practice/token_endpoint_auth_method_none

Conversation

@uvdsl

@uvdsl uvdsl commented May 1, 2025 •

Copy link
Copy Markdown
Owner

Addressing #6 - remaining a draft for now - due to UX considerations (login after each page reload is not nice).

@uvdsl uvdsl changed the title Addressing #6 - public client: token_endpoint_auth_method should be none Addressing [#6](https://github.com/uvdsl/solid-oidc-client-browser/issues/6) - public client: token_endpoint_auth_method should be none May 1, 2025
@uvdsl uvdsl changed the title Addressing [#6](https://github.com/uvdsl/solid-oidc-client-browser/issues/6) - public client: token_endpoint_auth_method should be none Addressing #6 - public client: token_endpoint_auth_method should be none May 1, 2025
uvdsl added 6 commits May 1, 2025 19:18
public clients are not supposed to use this flow
needed to modify Session constructor and login method signature
CSS will not issue refresh token despite that on silent authentication, but ESS will
@uvdsl

uvdsl commented May 2, 2025 •

Copy link
Copy Markdown
Owner Author

Now, we first try to renew tokens using the RefreshTokenGrant, if that does not work, we attempt silent authentication in the AuthorizationCodeGrant once, if that doesnt work, the session remains unauthenticated such that a user needs to manually login again (and be prompted).

Instead of storing the client_secret in the sessionStorage, we had to store the DPoP keypair that was used on the AuthorizationCodeGrant (prompt=consent) such that the RefreshTokenGrant works.

Note:
CSS/Pivot does not provide a refresh_token on silent authenticaton (i.e. prompt=none).
ESS does provide a new refresh_token.

UX:
Having a nice loading screen while session is restored (does not take too long) helps :)

@uvdsl uvdsl self-assigned this May 2, 2025
@uvdsl
uvdsl marked this pull request as ready for review May 2, 2025 13:24
@uvdsl
uvdsl marked this pull request as draft May 2, 2025 20:19
@uvdsl

uvdsl commented May 2, 2025 •

Copy link
Copy Markdown
Owner Author

Based on my current understanding, I think I want to use the RefreshTokenGrant only for token renewal (not re-establishing a session) such that we do not store any sensitive information in sessionStorage anymore.

Edit: TIL, we can store the non-extractable (!) DPoP KeyPair via the IndexedDB API and later retrieve the CryptoKey object and re-use the keys.

With the current IDPs, this poses a securer approach than using silent authentication in the AuthorizationCodeGrant :

  • CSS/Pivot and ESS (afaik) currently use sameSite=none on their session cookies
  • which in turn allows silent authentication via iframes and popups
  • which in turn allows an attacker upon successful JS execution in an app to execute silent authentication in the background
  • which in turn results in a set of tokens bound to an attacker controlled and thus certainly extractable DPoP keypair
  • which in turn allows the attacker to re-use the session outside of the compromised application.

@uvdsl uvdsl changed the title Addressing #6 - public client: token_endpoint_auth_method should be none Addressing #6 - public client: token_endpoint_auth_method should be none (Silent Authentication) May 3, 2025
@uvdsl uvdsl changed the title Addressing #6 - public client: token_endpoint_auth_method should be none (Silent Authentication) Addressing #6 - public client: token_endpoint_auth_method should be none (AuthCodeGrant prompt=none) May 5, 2025
@uvdsl uvdsl changed the title Addressing #6 - public client: token_endpoint_auth_method should be none (AuthCodeGrant prompt=none) Addressing #6 - public client: token_endpoint_auth_method should be none (AuthorizationCodeGrant top-level redirect prompt=none) May 5, 2025
@uvdsl

uvdsl commented May 5, 2025

Copy link
Copy Markdown
Owner Author

Suspending efforts on this; #9 is currently favored and merged.
If discussion arises, we can still reconsider our approach.

@uvdsl uvdsl closed this May 5, 2025
@uvdsl
uvdsl deleted the best_practice/token_endpoint_auth_method_none branch November 5, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant