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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Authorization as CORS header and OAuth minor fixes #2298

Merged
merged 6 commits into from Aug 28, 2019

Conversation

abulte
Copy link
Contributor

@abulte abulte commented Aug 26, 2019

This PR:

  • Allows to use implicit grant: it was not possible because we always had a secret set on an OAuth2Client, due to the way default works on a MongoEngine field. Implicit grant won't work if there's a secret set on the client. A Boolean field is_implicit is now available to bypass the secret logic. Actually, you can use client.secret = '' and it works fine 馃槵
  • Switches the token expiration times config from the now-unused Flask-OAuthlib syntax to the new authlib one. Set expiration time to 10 days for implicit grant tokens, vs 1 hour for the lib default. Set expiration time to 30 days for other grants, as we used to specify with OAUTH2_PROVIDER_TOKEN_EXPIRES_IN.
  • Adds the Authorization header as allowed PREFLIGHT_HEADERS, w/o this the implicit grant workflow is useless on a web app.

To be considered:

@abulte abulte changed the title Oauth fixes: expiration times and implicit grant Allow Authorization as CORS header and Oauth minor fixes Aug 28, 2019
@abulte abulte marked this pull request as ready for review August 28, 2019 14:37
@abulte abulte changed the title Allow Authorization as CORS header and Oauth minor fixes Allow Authorization as CORS header and OAuth minor fixes Aug 28, 2019
@abulte abulte requested a review from a team August 28, 2019 15:02
@abulte abulte merged commit 98f7e54 into opendatateam:master Aug 28, 2019
@abulte abulte deleted the oauth-fixes branch August 28, 2019 15:40
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.

None yet

2 participants