Skip to content
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

Use constants to form oauth2 error responses #1949

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

nabokihms
Copy link
Member

Signed-off-by: m.nabokikh maksim.nabokikh@flant.com

Overview

  • Used a constant as the first argument of newErr method
  • Replaced error state "invalid_requests" with "invalid_request" in case of receiving no response_type
  • Added a test

What this PR does / why we need it

According to https://tools.ietf.org/html/rfc6749#section-3.1.1, the state invalid_requests is invalid (and it looks like a typo).
To avoid similar errors in the future, this PR replaces all state arguments with constants.

Special notes for your reviewer

Correct error on empty response_type is required to pass the OpenID certification.

Does this PR introduce a user-facing change?

The only user-facing change is replacing invalid_requests with invalid_request.

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
@nabokihms nabokihms changed the title Use constants in errors Use constants to create oauth2 error responses Jan 18, 2021
@nabokihms nabokihms changed the title Use constants to create oauth2 error responses Use constants to form oauth2 error responses Jan 18, 2021
Copy link
Member

@bonifaido bonifaido left a comment

Choose a reason for hiding this comment

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

LGTM!

@sagikazarmark sagikazarmark merged commit a55de6c into dexidp:master Jan 19, 2021
@sagikazarmark sagikazarmark added this to the v2.28.0 milestone Jan 23, 2021
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