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

added ability to pass down url query parameters to initial oauth2.0 authorization page #503

Merged
merged 31 commits into from
Dec 4, 2018

Conversation

cosmomeese
Copy link
Contributor

added ability pass down url query parameters to the initial oauth2.0 authorization page. e.g. this is useful for the Fitbit API which defines additional URI parameters (such as token expiration duration, ability to force authorization page/consent and others - see Authorization Page @ https://dev.fitbit.com/build/reference/web-api/oauth2/) that must be appended to the initial authorization URL.

@cosmomeese

This comment has been minimized.

@jennybc

This comment has been minimized.

@cosmomeese

This comment has been minimized.

@jennybc

This comment has been minimized.

@cosmomeese

This comment has been minimized.

Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

Can you please do a pass over your changes with styler, or by manually following the rules at http://style.tidyverse.org/? It's currently rather hard for me to read the code.

@cosmomeese
Copy link
Contributor Author

Done - used 'styler' and tweaked manually when it didn't work so well. Let me know if it needs further tweaking.

Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

I think the idea is sound. I've made a bunch of suggestions to improve the style.

R/oauth-init.R Outdated Show resolved Hide resolved
R/oauth-init.R Outdated Show resolved Hide resolved
R/oauth-init.R Outdated Show resolved Hide resolved
R/oauth-init.R Outdated Show resolved Hide resolved
R/oauth-init.R Outdated Show resolved Hide resolved
tests/testthat/test-oauth-query-params.R Outdated Show resolved Hide resolved
tests/testthat/test-oauth-query-params.R Outdated Show resolved Hide resolved
tests/testthat/test-oauth-query-params.R Outdated Show resolved Hide resolved
tests/testthat/test-oauth-query-params.R Outdated Show resolved Hide resolved
tests/testthat/test-oauth-query-params.R Outdated Show resolved Hide resolved
@cosmomeese
Copy link
Contributor Author

Done.
Let me know if test_that("oauth2.0 authorize url with empty input does not append empty query params") is clearer (moved to test-oauth.R)

R/oauth-init.R Outdated Show resolved Hide resolved
R/oauth-init.R Show resolved Hide resolved
R/oauth-init.R Outdated Show resolved Hide resolved
R/oauth-init.R Outdated Show resolved Hide resolved
tests/testthat/test-oauth.R Outdated Show resolved Hide resolved
@cosmomeese
Copy link
Contributor Author

Done. Replaced the empty input test with something that's hopefully clearer, more concise and more useful.

Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

Looks great. One last thing: can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

@cosmomeese
Copy link
Contributor Author

Done - let me know if it's too wordy (or should be split up into more bullets).

@hadley hadley merged commit 4529493 into r-lib:master Dec 4, 2018
@hadley
Copy link
Member

hadley commented Dec 4, 2018

Thanks!

@cosmomeese
Copy link
Contributor Author

My pleasure - thanks for the all the help & guidance with this. :)

@jennybc
Copy link
Member

jennybc commented Apr 16, 2019

Hey @cosmomeese, you might like to know this feature comes in handy for Google OAuth flow too. We can pass the user's email address as a hint to the auth server, which pre-selects the targeted identity in the consent screen:

r-lib/gargle@3790e77

@cosmomeese
Copy link
Contributor Author

cosmomeese commented Apr 18, 2019

That's so great @jennybc! Thanks for letting me know - it's always nice to see one's work end up being useful to someone else :)

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