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

OAuth2 Owner Credentials flow now matches specification #4260

Closed
wants to merge 3 commits into from

Conversation

krotscheck
Copy link

Resubmission of #3913. I'll try to keep the branch safe from my autocleanup scripts until it merges.

Description

This pull request updates the "Password" flow to match the RFC, in
accordance to #3227, with the following changes:

  • Two methods have been explicitly removed (though names have been repurposed): Using login/pass in Basic Auth and including client_id and client_secret in the query string. The former has been removed because it is not in the specification at all, the latter because it's explicitly discouraged.
  • The "Basic" auth method now uses the client_id and client_secret in the Authorization header, via Basic auth, in accordance with RFC section 2.3.1: https://tools.ietf.org/html/rfc6749#section-2.3.1
  • The "Request Body" auth method now adds the client_id and the client_secret to the form body, in accordance to section 3.2.1: https://tools.ietf.org/html/rfc6749#section-3.2.1
  • The form no longer hides the client_id or client_secret.

Motivation and Context

  • Security: Putting client_id and client_secret in the query string will be cached by the browser, which is insecure.
  • Fixes OAuth2 Password Flow modes do not match RFC #3227
  • Usage: I want to add Password-based swagger UI to an OAuth2 server that I've built, and the implementation doesn't actually match the spec.

How Has This Been Tested?

I created a custom build including my fixes, and hosted them off of an OSS OAuth2 compliant authorization server, then validated that both private and public password-based clients could authenticate.

Types of changes

  • No code changes (changes to documentation, CI, metadata, etc)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This pull request updates the "Password" flow to match the RFC, in
accordance to swagger-api#3227, with the following changes:
- Two methods have been explicitly removed (though names have been
  repurposed): Using login/pass in Basic Auth and including client_id
  and client_secret in the query string.
- The "Basic" auth method now uses the client_id and client_secret
  in the Authorization header, via Basic auth, in accordance with RFC
  section 2.3.1: https://tools.ietf.org/html/rfc6749#section-2.3.1
- The "Request Body" auth method now adds the client_id and the client_secret
  to the form body, in accordance to section 3.2.1: https://tools.ietf.org/html/rfc6749#section-3.2.1
- The form no longer hides the client_id or client_secret.

This is a breaking change, as the UI now responds differently to the values
set in the configuration file.
@shockey
Copy link
Contributor

shockey commented Feb 27, 2018

Welcome back! We're focusing on cleaning out our PR and issue backlog this week, so this should move quickly 😄

@shockey
Copy link
Contributor

shockey commented Oct 3, 2019

Closing, as almost all of this ended up in #5066.

Thanks for your efforts, @krotscheck! Even though your PR didn't hit master, it made an influence 🙂

@shockey shockey closed this Oct 3, 2019
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.

OAuth2 Password Flow modes do not match RFC
2 participants