box / box-android-sdk

Apache License 2.0
62 stars 68 forks source link

Getting redirect_uri_mismatch error #449

Closed NLLAPPS closed 2 years ago

NLLAPPS commented 2 years ago

Hi, just noticed that my apps get redirect_uri_mismatch error when attempt to connect to BOX api.

I have seen https://support.box.com/hc/en-us/community/posts/5932333917459-Redirection-uri-mismatch-issue and understand the explanation but this was never the case.

Android App sample at https://github.com/box/box-android-sdk/blob/master/box-content-sample/src/main/java/com/box/androidsdk/sample/MainActivity.java does not set redirect uri and I had left OAuth 2.0 Redirect URI in the console to default https://app.box.com.

When I use https://app.box.com as BoxConfig.REDIRECT_URL then authentication works but user is redirected to https://app.box.com and SDK does not handle auth result.

Console at https://app.box.com/developers/console/ does not allow setting null/empty OAuth 2.0 Redirect URI either.

Since SDK has not changed for some time, something on your backend must have changed.

Question is, how would one handle auth result?

NLLAPPS commented 2 years ago

I have seen https://medium.com/box-developer-blog/oauth-2-0%E3%83%AA%E3%83%80%E3%82%A4%E3%83%AC%E3%82%AF%E3%83%88uri%E3%81%AE%E5%A4%89%E6%9B%B4-910fc5cac7b1

In Japanese. We have certainly received no communication bout this change and can see that SDK is not updated either.

Any time frame about updating SDK?

bartlomiejleszczynski commented 2 years ago

Hello,

Please note that currently Android SDK is not currently developed. There are no new releases planned as of now. However, we plan to revisit this topic in the next quarter (August - November) of this year.

However, we are currently taking a look into your topic and will check if there are any hints/ideas that we can suggest for you.

@mwwoda FYI

mwwoda commented 2 years ago

Hi @NLLAPPS You may be affected by the following change https://developer.box.com/changelog/#2022-05-18-oauth-20-redirect-url-release which was introduced some time ago. From now on, the redirect uri in the Box console should match the one set in your android app. For some time, the Box console has not allowed to set redirectUri as empty.

Since we don't support custom uri schemes (see https://github.com/box/box-android-sdk/issues/438), you should use the one with the http/https protocol. You can use the one that is set by default in the android sample app https://app.box.com/static/sync_redirect.html. Set it in the Box console as well and it should redirect you back to your app.

I hope this helps, Mateusz

NLLAPPS commented 2 years ago

Thank you.