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

redirect_uri_mismatch #39

Closed
1beb opened this issue Jun 18, 2013 · 4 comments
Closed

redirect_uri_mismatch #39

1beb opened this issue Jun 18, 2013 · 4 comments

Comments

@1beb
Copy link
Contributor

1beb commented Jun 18, 2013

Trying to manipulate your Google API demo for use with the Google Docs API. I can't seem to get past the point of defining cred.

Everything "seems" to work fine:

library(httr)
google <- oauth_endpoint(
  NULL, 
  "auth", 
  "token",
  base_url = "https://accounts.google.com/o/oauth2"
  )

myapp <- oauth_app(
  "google", 
  "100...apps.googleusercontent.com", 
  secret="MY_SECRET"
  )

cred <- oauth2.0_token(
  google, 
  myapp,
  scope = "https://www.googleapis.com/auth/drive.readonly"
  )

A browser window asking for authorization pops up, and then an otherwise blank page loads saying "Authentication complete - you can now close this page and return to R.".

However, looks at cred, I see:

error 
"redirect_uri_mismatch"

I'm not at all familiar with OAuth, but would be happy to debug upon instruction.

@hadley
Copy link
Member

hadley commented Nov 29, 2013

Can you please try with the dev version of httr? (devtools::install_github("httr")) This should be fixed now. Please feel free to reopen if it still doesn't work.

@hadley hadley closed this as completed Nov 29, 2013
@1beb
Copy link
Contributor Author

1beb commented Nov 29, 2013

In RStudio, this didn't work for me. So I tried it in just a standard terminal and R complained about not having Rook and httpuv installed. After installing, I was able to get the redirect and the token to set properly.

In RStudio, if I manually call Rook and httpuv, this works as expected. Without calling those libraries either the redirect fails (uri mismatch) or the authorization redirects to 404.

@hadley
Copy link
Member

hadley commented Nov 29, 2013

It works fine for me in a clean rstudio session. Can you please provide a reproducible example?

@1beb
Copy link
Contributor Author

1beb commented Dec 1, 2013

Haven't been able to produce it since I installed the dev version of httr, hopefully it was just a stale loaded version of httr that was causing the issue.

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

No branches or pull requests

2 participants