openid / AppAuth-JS

JavaScript client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
Apache License 2.0
977 stars 162 forks source link

Add support for acr_values option for authorization requests #110

Closed michaelkro closed 5 years ago

michaelkro commented 5 years ago

Expected Behavior

Authorization requests accept acr_values as an optional parameter. Open ID Spec

[REQUIRED] Describe expected behavior

When initializing a new instance of AuthorizationRequest, it accepts acr_values as a valid option.

new AuthorizationRequest({
  client_id: '<CLIENT_ID>',
  // ...
  acr_values: '<ACR_VALUES>'
})

Describe the problem

It is not possible to pass the acr_values option as a parameter for authorization requests

[REQUIRED] Actual Behavior

The server returns a 500 error when authorization requests contain the acr_values option

[REQUIRED] Steps to reproduce the behavior

Add acr_values as a parameter when initializing an instance of AuthorizationRequest

[REQUIRED] Environment

tikurahul commented 5 years ago

You should be using extras.

https://github.com/openid/AppAuth-JS/blob/master/src/authorization_request.ts#L28

You can pass-in any additional parameters you want using extras.

This is how these parameters are mixed-in. https://github.com/openid/AppAuth-JS/blob/master/src/authorization_request_handler.ts#L98

michaelkro commented 5 years ago

ok, thanks for the quick response @tikurahul!

michaelkro commented 5 years ago

Confirm that this is the correct solution. Thanks again!