Error: disallowed_useragent
Your Rocket.Chat.Android version: develop branch (commit c68d0a6651ef8d224c4c7ce188caed81dcaa1835)
Getting this error when trying to login using Google Auth to our own rocketchat server version 0.53.0
More information about the error is here: https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html
I'm believe this was fixed by rocket.chat server 0.54.2
Have upgraded Rocket.Chat server to 0.54.2, issue with Oauth still unfortunately persists.
Yeah, same error on the Android app after upgrading the rocketchat server to 0.54.2
@RocketChat/android i leave it to you. :grin: I know the ios project had an issue with authentication. I don't know if the same or not.
https://github.com/RocketChat/Rocket.Chat.iOS/issues/350
Setting the webview's user agent to "Chrome/56.0.0.0 Mobile" fixes this for me:
diff --git a/app/src/main/java/chat/rocket/android/fragment/oauth/AbstractOAuthFragment.java b/app/src/main/java/chat/rocket/android/fragment/oauth/AbstractOAuthFragment.java
index 0c1efb5..da1a841 100644
--- a/app/src/main/java/chat/rocket/android/fragment/oauth/AbstractOAuthFragment.java
+++ b/app/src/main/java/chat/rocket/android/fragment/oauth/AbstractOAuthFragment.java
@@ -127,6 +127,7 @@ public abstract class AbstractOAuthFragment extends AbstractWebViewFragment
}
resultOK = false;
+ webView.getSettings().setUserAgentString("Chrome/56.0.0.0 Mobile");
webView.loadUrl(url);
webView.addJavascriptInterface(new JSInterface(result -> {
// onPageFinish is called twice... Should ignore latter one.
I realize this is not a true fix since this should probably be done using a Chrome Custom Tab or something like that, but could this temporary fix be implemented and released to the play store? Our users can't authenticate using the G button with the current version on the play store.
@laggedHero :top:
@el-psycho can you open a PR with those changes? Fastest way to get the ball moving
PR created.
Hey guys, just wondering a ballbark estimate when we can expect to see this temp fix in a release on the Play store. Thanks.
Probably this week. I'm trying to round up autocomplete for users and channels to the same build.