[Solved] Problem with Gitlab CI OAUTH

Hello,

first at all - thank you very much for this super project!

We started testing Mattermost on a dedicated machine trying to authenticate with our Gitlab-Server on another machine.

After successful login in Gitlab after click on “Login with Gitlab” Gitlab redirects to Mattermost. The Message there is:

“We couldn’t find the existing account”

Its the same logging in with a new Mattermost user as with an existing user in Mattermost.

Both sites are encrypted. Mattermost has a nginx-proxy:

server {
listen 80;
#server_name mattermost.our.site;
return 301 https://mattermost.our.site$request_uri;
}

server {
listen 443;
server_name mattermost.our.site;

    ssl on;
    ssl_certificate /etc/nginx/ssl/our.crt;
    ssl_certificate_key /etc/nginx/ssl/our.key;

    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

    client_max_body_size 4G;

    location / {
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            #proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-Proto "https";

proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_redirect off;
proxy_pass http://localhost:8065;
}

    location /api/v1/websocket {
            proxy_pass http://localhost:8065;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
    }

}

Where should we continue to investigate?

Thank you!

Solved it: In Gitlab we had to neter two URI:
https://mattermost.our.site/signup/gitlab/complete
https://mattermost.our.site/login/gitlab/complete

Thank you anyway!