Custom oAuth2 provider

Is it possible to use external SSO/oAuth2 to authenticate gitlab users? If yes - how?