I have a webapp with 2 login options: using your Github account or your GitLab account.
At the moment, these 2 logins are treated as different accounts: login with Github, see only your Github repos; login with GitLab, see only your GitLab stuff.
However, I notice apps such as Coveralls.io managed to link the logins: if you login with Github and GitLab, then you will see all your repos (Github and GitLab repos, no matter what future login options you choose).
So, how does Coveralls know that it's the same user?
Same in StackOverflow: if I originally authenticate with Github, I get an account and if later I authenticate with GMail, it's the same account. How is this achieved?
The only option I can think of is the e-mail address registered with the different Oauth providers: if it's the same, then wire different logins to the same account.
This is doable because the app in question links a generic user account with identities related to each OAuth provider.
You can see an example of this in https://jumpstartrails.com/, the SaaS application created by Chris Oliver, creator of https://gorails.com/. That app implements this very pattern.
Also, this GoRails video by Chris may explain the approach:
Login with Multiple OAuth Providers using Omniauth: https://gorails.com/episodes/login-with-multiple-oauth-providers?autoplay=1