Repository navigation
Conversation
feat(server): add RFC 9126 Pushed Authorization Requests (PAR) support to OAuth Add Pushed Authorization Request (PAR) support to the OAuth/OIDC authorization flow in OAuthRepository.authorize() when the identity provider advertises pushed_authorization_request_endpoint in server metadata. When pushed_authorization_request_endpoint is present, authorization parameters (redirect_uri, scope, state, PKCE code_challenge and code_challenge_method, and optional prompt) are pushed over a backchannel request using buildAuthorizationUrlWithPAR, and the browser redirect URL is built from the returned request_uri. When absent, authorization falls back to standard buildAuthorizationUrl. Reuses the openid-client instance from getClient(), preserving existing client authentication methods, request timeouts, and allowInsecureRequests settings while remaining backward-compatible with providers that do not support PAR.
|
Label error. Requires exactly 1 of: changelog:.*. Found: 🗄️server. A maintainer will add the required label. |
|
This PR has been automatically closed as the description doesn't follow our template. Please make sure every section is present and filled in. After you edit it to match the template, the PR will automatically be reopened. |
|
From reading into it, it seems like this actually does not bring any significant security benefits to Immich users (since we only send redirect_uri, scope, state, the PKCE challenge, and
Overall, while the change may look minimal, I think this adds another point that can possibly break for users and thus provide an inferior experience. In fact, since there isn't any config for this, people cannot even turn of PAR if their IDP supports it. However, I don't really want to add the additional complexity in the form of another config setting for this either. Tl;dr unless you have a really strong security argument for this and Immich's use cases that I might have missed/am not aware of, I will close this PR. Sorry! |
|
Talked with Daniel on discord, closing this |
feat(server): add RFC 9126 Pushed Authorization Requests (PAR) support to OAuth
Add Pushed Authorization Request (PAR) support to the OAuth/OIDC authorization flow in OAuthRepository.authorize() when the identity provider advertises pushed_authorization_request_endpoint in server metadata.
When pushed_authorization_request_endpoint is present, authorization parameters (redirect_uri, scope, state, PKCE code_challenge and code_challenge_method, and optional prompt) are pushed over a backchannel request using buildAuthorizationUrlWithPAR, and the browser redirect URL is built from the returned request_uri. When absent, authorization falls back to standard buildAuthorizationUrl.
Reuses the openid-client instance from getClient(), preserving existing client authentication methods, request timeouts, and allowInsecureRequests settings while remaining backward-compatible with providers that do not support PAR.
Description
Adds support for RFC 9126 Pushed Authorization Requests (PAR) during the OAuth/OIDC authorization flow when advertised by the identity provider.
It enables more secure OIDC authentication by pushing authorization parameters over a backchannel request using buildAuthorizationUrlWithPAR (which openid-client already provides) when pushed_authorization_request_endpoint is present in server metadata, and falling back to standard buildAuthorizationUrl otherwise.
Fixes # (issue)
None
How Has This Been Tested?
Tested against Pocket ID using both hardware security keys and platform authenticators (Windows Hello and Android built-in passkeys) across Chrome, Edge, Brave, and Android.
Screenshots (if appropriate)
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
Used an LLM only to check openid-client PAR helpers and trace the flow; I wrote the change and tested it myself.
...
...