# \[Solved\] Problem with Gitlab CI OAUTH

**URL:** <https://forum.mattermost.com/t/solved-problem-with-gitlab-ci-oauth/379>\
**Category:** Troubleshooting\
**Created:** [October 19, 2015, 6:01pm UTC](https://forum.mattermost.com/t/solved-problem-with-gitlab-ci-oauth/379 "2015-10-19T18:01:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kingfisher77](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/kingfisher77/32/172_2.png) [@kingfisher77](https://forum.mattermost.com/u/kingfisher77)\
**Post date:** [October 19, 2015, 6:01pm UTC](https://forum.mattermost.com/t/solved-problem-with-gitlab-ci-oauth/379/1 "2015-10-19T18:01:02Z")

</div>

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](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!

---

<div class="post-metadata">

**Author:** ![kingfisher77](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/kingfisher77/32/172_2.png) [@kingfisher77](https://forum.mattermost.com/u/kingfisher77)\
**Post date:** [October 19, 2015, 9:05pm UTC](https://forum.mattermost.com/t/solved-problem-with-gitlab-ci-oauth/379/2 "2015-10-19T21:05:07Z")

</div>

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

Thank you anyway!
