gballet / ueberauth_gitlab

GitLab OAuth2 strategy for Überauth.
The Unlicense
1 stars 1 forks source link

Ü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
  4. Add Gitlab to your Uberauth configuration:

    config :ueberauth, Ueberauth,
    providers: [
      ...
      gitlab: {Ueberauth.Strategy.Gitlab, []}
    ]
  5. 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")
  6. 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.