@pravi FYI, I was not able to reproduce this problem on another GitLab Omnibus installation; the callback URL was similar as above.
I did more testing on git.fosscommunity.in. I'm having a hard time connecting my GitLab.com to my account in the first place. It looks to me after GitLab.com makes the callback to git.fosscommuity.in, the GitLab CE installation there never registers the proper state:
I click "Authorize"
This redirects to https://git.fosscommunity.in/users/auth/gitlab/callback?code=<code>&state=<state>
git.fosscommunity.in redirects me to the sign_in page
Something is wrong there. Can you check your logs to see if there's a reason to connect?
@stanhu I can confirm this is caused by omniauth-oauth2 version 1.4.0. I downgraded it to 1.3.1 and login with gitlab.com works now. From the upstream issue, they expect omniauth-gitlab to fix it (as they fixed omniauth-google-oauth2).
I just tried bumping to 1.4.0, and I see this in the error logs:
21:26:04 rails-web.1 | I, [2016-11-07T21:26:04.245007 #56637] INFO -- omniauth: (gitlab) Callback phase initiated.21:26:05 rails-web.1 | E, [2016-11-07T21:26:05.068009 #56637] ERROR -- omniauth: (gitlab) Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
I then noticed that gitlab-omniauth had this commit: