MaikuB / flutter_appauth

A Flutter wrapper for AppAuth iOS and Android SDKs
275 stars 245 forks source link

disallowed_useragent when running on Android #267

Closed murphycrosby closed 2 years ago

murphycrosby commented 2 years ago

I'm using Auth0 and followed this to get it setup with to login in wuth Auth0.

https://auth0.com/blog/get-started-with-flutter-authentication/

However when I run on Android, when I click login, I get an "Authorization Error", "Error 403: disallowe_useragent". "You can't sign in from this screen because this app doesn't comply wuth Google's embeded webview policy. If this app has a website, you can open a web browser and try signing in from there."

The Android version is Android 11.

Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 18116933e7 (7 weeks ago) • 2021-10-15 10:46:35 -0700 Engine • revision d3ea636dc5 Tools • Dart 2.14.4

MaikuB commented 2 years ago

Haven't come across this before but sounds like you'd need to check your device, app or some other configuration. That error reads like it's opened the login page in a webview instead of a separate browser. Typically this would be a Chrome custom tab

diego-rangel commented 2 years ago

I have the exact same issue here. Any news?

murphycrosby commented 2 years ago

Nope...not from me. @MaikuB it does open the login in Webview...I'm trying to login to application using Auth0...see the link here which has screenshots (https://auth0.com/blog/get-started-with-flutter-authentication/). Works fine on iOs, just not on Android.

MaikuB commented 2 years ago

@murphycrosby not sure what exactly I'm meant to get from the screenshots from the article. The Android screenshot shows it in a Chrome custom tab not a webview. Furthermore, the AppAuth Android SDK doesn't support webviews to begin with so I don't see how this is technically possible to begin with unless your device doesn't have a supported browser. Please check your device and/or app configuration more closely. You may also need to check Auth0 configuration. If you haven't already, you should also check using other devices and emulators with Chrome on them. This issue isn't something i can help with as it sounds like a device issue/limitation and the plugin uses SDKs that do the heavy lifting

Note: I've only seen the repo for the Android SDK have one reported issue on this and the person reporting never provided information on the browser

diego-rangel commented 2 years ago

I already figured it out. Just create another Android Emulator with Google Play services enabled and it is going to work perfectly.

Kennnv commented 2 years ago

Is there a way this could be handled so that on devices older than Android 11, it won't open webview and instead opens a browser?