omniauth / omniauth_openid_connect

MIT License
170 stars 187 forks source link

Add token request parameters for authorization code flow #191

Closed coberlin closed 1 month ago

coberlin commented 1 month ago

The access token request needs the code if we're using code flow. Some providers require additional parameters such as grant_type and redirect_uri.

To run tests, pin the minitest version per a conflict with mocha, as noted here: https://github.com/freerange/mocha/issues/614 But do not leave pinned as the gem fails to install under some rubies that previously succeeded.

For example: net-imap-0.5.0 requires ruby version >= 3.1.0, which is incompatible with the current version, ruby 2.6.8p0 (jruby 9.3.7.0)

Also, Set grant type explicitly when response type is code

Setting the grant_type to :authorization_code in extra_token_params results in token requests with multiple grant types separated by commas, with authorization_code appended to the end, which results in invalid grant type error from the provider.

coberlin commented 1 month ago

Update: Changing request to require redirect_uri -- it is required, not optional, per https://docs.duendesoftware.com/identityserver/v7/reference/endpoints/token/

coberlin commented 1 month ago

Update: Changing request to require redirect_uri -- it is required, not optional, per https://docs.duendesoftware.com/identityserver/v7/reference/endpoints/token/