Überauth Gitlab
GitLab OAuth2 strategy for Überauth.
Installation
Setup your Gitlab application
Add
:ueberauth_gitlabas a dependency inmix.exs:def deps do [{:ueberauth_gitlab, "~> 0.1"}] endAdd the strategy to your application:
def application do
[applications: [:ueberauth_gitab]]
end- Add Gitlab to your Uberauth configuration:
config :ueberauth, Ueberauth,
providers: [
...
gitlab: {Ueberauth.Strategy.Gitlab, []}
]- Configure the provider with the application registration credentials, setting the actual values in environment variables:
config :ueberauth, Ueberauth.Strategy.Gitlab.OAuth,
client_id: System.get_env("GITLAB_CLIENT_ID"),
client_secret: System.get_env("GITLAB_CLIENT_SECRET")-
Make sure that the
/auth/:providerand/auth/:provider/callbackroutes are properly configured, as explained in the Ueberauth documentation
Usage
Authentication is then available at your application's /auth/gitlab endpoint.