Fix that authorization code is returned by fragment if response_mode is fragament #1511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
There is a problem that the authorization code is returned in the query even if "fragment" is specified for response_mode in the authorization request.
Other Information
Whether the authorization code is returned as a query or as a fragment is determined by the following in
CodeResponse
.doorkeeper/lib/doorkeeper/oauth/code_response.rb
Lines 43 to 47 in a56b1a5
In order for this to be determined correctly,
response_on_fragment
must be passed when initializingCodeResponse
.However, since
response_on_fragment
is not specified whenCodeReponse
is initialized inCodeRequest
.Therefore, the authorization code is always returned in query.