Doesn't work on Samsung Galaxy Note 4 (and probably Note 3)
See original GitHub issueHi!
It seems that the Samsung browser (“com.sec.android.app.sbrowser”) on the Galaxy Note 4 and probably also the Galaxy Note 3 does not return to the app after the user has clicked the “Allow” button in the Google login web page. Instead it just loads “www.google.com”, which is the fallback if the app cannot be started as far as I know. So the app does not get any login information and cannot proceed with the authentication.
A workaround is to ignore that browser so that Google Chrome is used instead. E.g. this code has fixed the issue for me:
new AuthorizationService(this,
new AppAuthConfiguration.Builder()
.setBrowserMatcher(new BrowserMatcher() {
@Override
public boolean matches(@NonNull BrowserDescriptor descriptor) {
if (descriptor.useCustomTab
&& StringUtils.equals(
descriptor.packageName,
"com.sec.android.app.sbrowser")) {
return false;
}
return true;
}
}).build())
However it would be good if it would work “out of the box”, i.e. if the AppAuth library could handle (blacklist?) this by itself. I have found functions to blacklist certain versions of a browser in AppAuth but it seems that it doesn’t blacklist any browsers by itself.
What do you think? Should AppAuth blacklist this automatically? Samsung probably won’t fix these old devices any more.
Kind regards
Dominique
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
@camhart The function above does not completely blacklist the Samsung browser. It will still use it if no other browser is available.
The reason is the descriptor.useCustomTab flag. The library will first try to find a browser that supports custom tabs. Only if no such browser is found it will use browsers without custom tabs. And my function above only blacklists the Samsung browser in the search for custom tab browsers. So when searching browsers without support for custom tabs the Samsung browser will still be taken into account (but will probably nevertheless fail to work correctly).
Any updates here? I’ve seen it occasionally on the Samsung Galaxy S6.
@dg76 Do you know if android devices are guaranteed to have a browser other than the samsung one? I’m concerned blacklisting it will result in no browser being available.