@elias,
Thanks for the suggestion. I suppose I'm not completely clear on how to implement what you suggest.
As part of the gitlab set-up that I'm working with, I believe the following (documented at the link below) has already been implemented.
https://docs.mattermost.com/deployment/sso-gitlab.html
That therefore provides a 'login with gitlab' option on the mattermost homepage. But, as you pointed out above, that results in no password getting assigned to my user in mattermost and therefore no ability to access the mattermost API.
I think you were suggesting to follow these docs (link below) to set up Gitlab separately as an oauth2 provider, which I followed, setting up as Trusted: Yes and using https://gitlab.mydomain.com
as the homepage url ... and http://gitlab.mydomain.com/users/auth/gitlab/callback
as the callback URL.
https://docs.mattermost.com/developer/oauth-2-0-applications.html
According the link above:
Once you have created an OAuth 2.0 application, all users on the Mattermost server are automatically given access to it.
However, if I go back to the mattermost main menu > account-settings > security ... and look under OAuth2 applications, I just see 'No OAuth 2.0 Applications are authorized.' Does Mattermost therefore require a restart for newly added OAuth2 applications to show up?
Also, back in Gitlab, presumably I need to set up a new application (separate to the Gitlab Mattermost that has already been set up) ... and use the client ID and client secret that were part of my OAuth2 set-up above?
I'm wondering will this then result in two separate login choices for gitlab on the mattermost home page?