Federated authentiction? (Omniauth + oAuth2 provider)

Hi all

Does anyone know if Gitlab (self-hosted) can function as a federated authentication provider? I.e. can I set up Omniauth use my Okta account for login, and then create oAuth2 apps in Gitlab for other apps (eg. Mattermost). The desired outcome would be:

  1. Try and log in via the Mattermost login page
  2. Get redirected to the Gitlab login page
  3. Sign in with Okta (or Google or any other Omniauth provider)
  4. Get redirected and logged in to Mattermost

Cheers