Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(oidc): Align OidcAuthCodeUrlBuilder behavior with next-gen auth MSCs #4699

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zecakeh
Copy link
Collaborator

@zecakeh zecakeh commented Feb 20, 2025

The first commit removes support for Pushed Authorization Requests. PAR is a small optimization that sends the parameters via a request first, and returns an ID that we used in the authorization URL instead of the parameters, so it only makes the authorization URL smaller by reducing the size of the query part. It is no mentioned in the next-gen auth MSCs and it is not supported by the oauth2 crate so let's remove it already.

The second commit removes most of the optional parameters of the authorization URL. All those parameters are specified in OpenID Connect, but the next-gen auth MSCs were downgraded to OAuth 2.0 which doesn't have those parameters.

Only the following parameters are defined in the MSCs:

  • prompt=create is defined in MSC2964
  • login_hint=mxid:@user:server.name is defined in MSC4198

It is a small optimization which makes the URL smaller, but it is not
part of the next-gen auth MSCs and is not supported by the oauth2 crate,
so let's drop it.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner February 20, 2025 10:31
@zecakeh zecakeh requested review from Hywan and removed request for a team February 20, 2025 10:31
@zecakeh zecakeh changed the title reefactor(oidc): Align AuthCodeUrlBuilder behavior with next-gen auth MSCs reefactor(oidc): Align OidcAuthCodeUrlBuilder behavior with next-gen auth MSCs Feb 20, 2025
…MSCs

`prompt=create` is defined in MSC2964, and
`login_hint=mxid:@user:server.name` is defined in MSC4198.
The other parameters came from OpenID Connect.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh changed the title reefactor(oidc): Align OidcAuthCodeUrlBuilder behavior with next-gen auth MSCs refactor(oidc): Align OidcAuthCodeUrlBuilder behavior with next-gen auth MSCs Feb 20, 2025
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.99%. Comparing base (017a947) to head (b65a63f).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4699      +/-   ##
==========================================
+ Coverage   85.89%   85.99%   +0.10%     
==========================================
  Files         292      292              
  Lines       33909    33855      -54     
==========================================
- Hits        29126    29114      -12     
+ Misses       4783     4741      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hywan Hywan requested review from poljar and removed request for Hywan February 20, 2025 12:16
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