flutter_appauth icon indicating copy to clipboard operation
flutter_appauth copied to clipboard

disallowed_useragent when running on Android

Open murphycrosby opened this issue 4 years ago • 6 comments

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

murphycrosby avatar Dec 03 '21 00:12 murphycrosby

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

MaikuB avatar Dec 13 '21 08:12 MaikuB

I have the exact same issue here. Any news?

diego-rangel avatar Dec 28 '21 05:12 diego-rangel

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.

murphycrosby avatar Dec 29 '21 04:12 murphycrosby

@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

MaikuB avatar Jan 01 '22 21:01 MaikuB

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

diego-rangel avatar Jan 01 '22 21:01 diego-rangel

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?

Kennnv avatar Sep 17 '22 17:09 Kennnv