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

ERR_UNKNOWN_URL_SCHEME while authenticating using oauth2 #438

Open
4 tasks done
dabeku opened this issue Mar 18, 2021 · 3 comments
Open
4 tasks done

ERR_UNKNOWN_URL_SCHEME while authenticating using oauth2 #438

dabeku opened this issue Mar 18, 2021 · 3 comments
Assignees
Labels

Comments

@dabeku
Copy link

dabeku commented Mar 18, 2021

  • I have checked that the [SDK documentation][sdk-docs] doesn't solve my issue.
  • I have checked that the [API documentation][api-docs] doesn't solve my issue.
  • I have searched the [Box Developer Forums][dev-forums] and my issue isn't already reported (or if it has been reported, I have attached a link to it, for reference).
  • I have searched [Issues in this repo][github-repo] and my issue isn't already reported.

Description of the Issue

I use Box in my iOS and Android app (same client id and client secret as I only want to manage the app once). I recently switched to oauth2 in the iOS app which works fine. I set the redirect URI in the box developer console to boxsdk-MY_CLIENT_ID://boxsdkoauth2redirect which works fine for iOS. When I try to use oauth2 using the same redirect URI in Android, I get an ERR_UNKNOWN_URL_SCHEME error after login to Box inside the app.

Strangely, when I close and restart the app, everything seems to work fine: I got a valid Box client which can be used to access Box.

Expected Behavior

I expect the login to work correctly so I don't have to restart the app.

Error Message, Including Stack Trace

Only a short toast showing authentication failed with ERR_UNKNOWN_URL_SCHEME

@dabeku
Copy link
Author

dabeku commented Mar 18, 2021

This issue seems to be known for some time now as shown here: https://support.box.com/hc/en-us/community/posts/360051837033-Box-mobile-SDKs-and-upcoming-redirect-url-change but doesn't seem have a high priority.

If anyone has the same issue: The only way to solve this issue is to create a duplicate app in box developer console and set a different OAuth 2.0 Redirect URI.

@sujaygarlanka
Copy link
Contributor

@dabeku We have updated the iOS SDK to accepting many variations or URI's recently. I would try using the URI that worked well with your android app in the iOS SDK. To do so, you must upgrade to the most recent version of the iOS SDK. Hope this helps!

@dabeku
Copy link
Author

dabeku commented Mar 21, 2021

I already tried that but this results in an invalid_client error although the client_id is correct (in iOS). There must be a way to support custom URL schemes as the Dropbox API for Android does exactly that (see data android:scheme="db-YOUR_APP_KEY_HERE" here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants