-
Notifications
You must be signed in to change notification settings - Fork 991
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
Feature request: Add Support for RFC 9126: Pushed Authorization Requests (PAR) #653
Comments
Looking at this myself there is at least one gotcha that may need to be accounted for. The if strings.Contains(c.Endpoint.AuthURL, "?") {
buf.WriteByte('&')
} else {
buf.WriteByte('?')
} It should be also noted that the only parameter that should be present for authorization requests leveraging RFC9126 should be the |
@theadell I second this request as I am currently working on a project that wants to use PAR to increase security. Do you have a PR in the works or may I have a go at it? |
@james-d-elliott You are right. I edited the feature request to address that. |
I would like to propose adding support for the Pushed Authorization Requests (PAR)
Adding support for PAR improves security by sending the authorization request via the back channel (HTTPS) rather than the front channel (browser redirects). This minimizes the exposure of sensitive data and reduces the possibility of Man-In-The-Middle (MITM) attacks.
Moreover, with PAR, the authorization request may be authenticated, meaning that only legitimate clients can initiate the OAuth flow. This strengthens security by ensuring that only clients with the appropriate credentials can make authorization requests.
This feature is also particularly useful when used in conjunction with JWT Secured Authorization Request (RFC 9101), making the handling of more complex requests more efficient.
To implement RFC 9126 I propose extending the
Endpoint
struct to include anPARURL
field:A new method
PushAuthRequest
is added to theConfig
structThis RequestPAR method would be responsible for creating a Pushed Authorization Request (PAR) by sending an HTTP POST request to the authorization server with the necessary parameters. Essentially it takes any parameter that can be passed to
AuthCodeURL
It returns a URL to OAuth 2.0 provider's consent page which contains a reference to the authorization request made.
An Example usage
The text was updated successfully, but these errors were encountered: