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

Imgur doesn't accept redirect_uri #1017

Open
garyyeap opened this issue Sep 1, 2024 · 3 comments
Open

Imgur doesn't accept redirect_uri #1017

garyyeap opened this issue Sep 1, 2024 · 3 comments

Comments

@garyyeap
Copy link

garyyeap commented Sep 1, 2024

Issue

I followed the instructions provided in #516 (comment).

react-native-app-auth generated the url:

https://api.imgur.com/oauth2/authorize?redirect_uri=com.myapp%253A%252F%252Foauth&client_id=xxxx&response_type=code&state=CeCjYuaMTtKVEuGvcW5EtA&nonce=DK8X_F3jH_z7F2dxgcNfRQ&code_challenge=eaUwn9soj0T-o2xMJCFj0WDZShVjoS1ENrLOSZVWX_s&code_challenge_method=S256

However, this resulted in an error:

{
  "data": {
    "error": "The redirect URI provided is missing or does not match",
    "request": "/oauth2/authorize",
    "method": "POST"
  },
  "success": false,
  "status": 400
}

Since the Imgur API documentation doesn't mention the need for a redirect_uri, I decided to remove it from the URL:

https://api.imgur.com/oauth2/authorize?client_id=xxxx&response_type=code&state=CeCjYuaMTtKVEuGvcW5EtA&nonce=DK8X_F3jH_z7F2dxgcNfRQ&code_challenge=eaUwn9soj0T-o2xMJCFj0WDZShVjoS1ENrLOSZVWX_s&code_challenge_method=S256

This modification successfully resolved the error.

Environment

  • Your Identity Provider: imgur
  • Platform that you're experiencing the issue on: Android
  • Your react-native Version: 0.74.5
  • Your react-native-app-auth Version: 8.0.0
  • Are you using Expo? Yes
@carbonrobot
Copy link
Contributor

If you do not provide a redirect_uri, then Imgur can not send the user back to your application. In order for the redirect URI to work, the one configured in your application must match the one configured in your Imgur Oauth account settings.

@garyyeap
Copy link
Author

garyyeap commented Sep 2, 2024

It can, witthout providing the redirect_uri. I tested out. I believe Imugur just follow the url from their application setting but not the query string. Do I need to record a video to prove it?

image

@carbonrobot
Copy link
Contributor

Thanks for the screenshot, that clarifies things for us (since we don't have an account with every provider, it can be difficult to test sometimes). We can look at making the redirectUrl property optional in the configuration.

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