Überauth Gitlab

GitLab OAuth2 strategy for Überauth.

Installation

  1. Setup your Gitlab application

  2. Add :ueberauth_gitlab as a dependency in mix.exs:

     def deps do
       [{:ueberauth_gitlab, "~> 0.1"}]
     end
  3. Add the strategy to your application:

  def application do
    [applications: [:ueberauth_gitab]]
  end
  1. Add Gitlab to your Uberauth configuration:
  config :ueberauth, Ueberauth,
    providers: [
      ...
      gitlab: {Ueberauth.Strategy.Gitlab, []}
    ]
  1. 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")
  1. Make sure that the /auth/:provider and /auth/:provider/callback routes are properly configured, as explained in the Ueberauth documentation

Usage

Authentication is then available at your application's /auth/gitlab endpoint.