mattermost-mobile: Problem using Google Auth in Mattermost mobile (ios/android) versions

Summary

Trying to use google auth in mobile (android and ios) is returning an Error: disallowed_useragent on google’s side.

Followed the instructions on how to set it up in the site and works perfectly on the web. Haven’t made it work in android/ios/mac clients.

Environment Information

  • Device Name: Samsung Galaxy S8
  • Mattermost App Version: latest
  • Mattermost Server Version: latest

Steps to reproduce

Enable Google Auth in the system console, configure with the right api credentials and try to log in using a current user.

Expected behavior

It should log you in.

Observed behavior

screenshot_20170613-141648

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 39 (5 by maintainers)

Most upvoted comments

any update?

** Bounty added - expires on 15th February 2021 **

I’d really like this fixed but don’t have the ready skills to do it myself. I’ve posted a $500 bounty on this: https://www.bountysource.com/issues/46286041-problem-using-google-auth-in-mattermost-mobile-ios-android-versions

Requirements would be: Auth with Google IDP succeeds, change must be merged and available in the iOS AND Android store-based apps for bounty to be paid. Solution can either be the user agent (if you can convince the team to merge it) or (preferably) the “proper” way of authing with google, firing up an external browser.

Please all feel free to add to my bounty if you’d like to help motivate someone to fix this.

Thanks for the link. So this is still unresolved.

We did an emergency switch to Mattermost because RocketChat broke our instance several times due to auto-update issues of the snap distribution. However, without a working mobile client using Google OAuth, Mattermost is not really an interesting alternative 😕

I can confirm https://github.com/mattermost/mattermost-mobile/issues/622#issuecomment-450472819 approaach worked for us. We haven’t added any test but we were able to login using google auth and the webview approach.

Any update on this ?

@enahum OK I’ll do it.

Here is my plan:

  • setup a build/config parameter to change the user agent declared by the web view
  • provide a default value that works for the Google Auth
  • attempt to use this user agent only for Google Auth URLs to minimize the impact

This would be my first Mattermost PR, so I’ll have to setup my dev env first. But the documentation looks great.

In the meantime, please re-open this so people know it’s being dealt with.

Hi @thobai + others,

For those using GitLab SSO, we don’t officially support connecting to other authentication methods through GitLab. That being said, we’ve been investigating Google Auth since it’s one of our enterprise edition features, summary of what we’ve found is below.

The issue is that Google revoked the ability to use a WebView to authenticate using their OAuth2 provider. Since GitLab uses a web application flow, it needs the WebView to work.

To use the Google Login libraries instead of a webview, you need to compile the app with a google-service.json file in order to make use of your own Google Api Key. So it’s looking like anyone using Google Auth would need to compile the apps themselves.

@lfbrock this happens on both versions of the mobile apps.

My use case: team uses Google as auth server for Gitlab.