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

Add option user_params to oauth2.0_token to enable endpoint-specific access parameters. #312

merged 6 commits into from
Jan 7, 2016


Copy link

@cornf4ke cornf4ke commented Jan 5, 2016

This branch holds the implementation for passing additional access parameters in the form of a list of named values to the oauth2.0_token function. The function refresh_oauth2.0 was modified accordingly.

The service account functionality was not touched. My only reference for the use of user_params, Microsoft Azure AD, uses quite different parameters for service-to-service authorization when compared to httr's init_oauth_service_account. See

A demo for the Azure AD endpoint was added. In the committed version it uses dummy credentials and will run but not succeed.

While viewing the diffs on github, I noticed a possible typo in the demo/00Index line
"oauth2-linkedin Using linkedin api with OAuth 1.0" which probably should read "OAuth 2.0".

redirect_uri = redirect_uri,
grant_type = "authorization_code",
code = code))
req_params <- c(
Copy link

Choose a reason for hiding this comment

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

I think it would be slightly better to use stats::modifyList() and change the order of the argument so that user_params "loses" if a name is defined in both places.

Copy link

hadley commented Jan 5, 2016

Apart from a couple of minor things, looks good. Could you please also add a bullet point to NEWS?

Copy link

cornf4ke commented Jan 6, 2016

Thanks for your comments. I added the news bullet and modified the code according to your notes.

hadley added a commit that referenced this pull request Jan 7, 2016
Add option user_params to oauth2.0_token to enable endpoint-specific access parameters.
@hadley hadley merged commit d746b31 into r-lib:master Jan 7, 2016
@cornf4ke cornf4ke deleted the user_params branch January 8, 2016 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants