Skip to content

Fix the error message for force_pkce - #1755

Merged
nbulaj merged 2 commits into
doorkeeper-gem:mainfrom
lurz:force_pkce_error_message
Dec 23, 2024
Merged

Fix the error message for force_pkce#1755
nbulaj merged 2 commits into
doorkeeper-gem:mainfrom
lurz:force_pkce_error_message

Conversation

@lurz

@lurz lurz commented Dec 19, 2024

Copy link
Copy Markdown
Contributor

Summary

Bug

When the force_pkce option is enabled for a public client, and the authorization code request doesn't include a code_challenge, the error message returned is

"The authorization server encountered an unexpected condition which prevented it from fulfilling the request."

Root cause

[#1705] didn't add the error message in the locales.

Fix

Base on RFC https://datatracker.ietf.org/doc/html/rfc7636#section-4.4.1, we should return an "invalid_request" error with a proper description. I added a new entry for the error message and included a test to verify the proper message is returned.

lurz added 2 commits December 18, 2024 21:30
Bug
When the `force_pkce` option is enabled for a public client, and the
authorization code request doesn't include a code_challenge, the
error message returned is

"The authorization server encountered an unexpected condition which prevented it from fulfilling the request."

Root cause
PR doorkeeper-gem#1705 didn't add
the error message in the locales.

Fix
Base on RFC https://datatracker.ietf.org/doc/html/rfc7636#section-4.4.1,
we should return an "invalid_request" error with a proper description.
I added a new entry for the error message and included a test to verify
the proper message is returned.
@nbulaj

nbulaj commented Dec 20, 2024

Copy link
Copy Markdown
Member

@mattmanning can you please take a look? 🙏

@mattmanning mattmanning left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks!

@nbulaj nbulaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from my side as well, thanks!

@nbulaj
nbulaj merged commit 6f249c8 into doorkeeper-gem:main Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants