Launch queries on the Mattermost API, having Gitlab as authentication provider

@serge or @elias
I’m not sure if this is applicable to my use-case, but I have set up mattermost within gitlab (ie. the omnibus edition, I believe), as per this demo.

In this instance, Gitlab is used for authentication when entering the Mattermost GUI. While that still creates a ‘user’ (corresponding to the Gitlab user) in the mattermost database, it doesn’t appear to assign a password … and so running this login in order to get a session token returned in the header is no longer working.

curl -X POST -H "Content-Type: application/json" -d '{"login_id": "username", "password": "gitlab_password"}' "https://mattermost.mydomain.com/api/v3/users/login"

Instead, it’s returning with this error, eventhough the user does exist:

{
  "id": "store.sql_user.get_for_login.app_error",
  "message": "We couldn't find an existing account matching your credentials. This team may require an invite from the team owner to join.",
  "detailed_error": "",
  "request_id": "f7i8ffgc8tyaf8pc9q1j4oixey",
  "status_code": 400
}

I was wondering if either you you were able to resolve this, since I would like to be able to use the mattermost API as I had before, when I was running Mattermost on a stand-alone basis.

Thanks.