{"id":22683231,"url":"https://github.com/mtchavez/ueberauth_gitlab","last_synced_at":"2025-04-12T18:26:10.222Z","repository":{"id":30501784,"uuid":"109630753","full_name":"mtchavez/ueberauth_gitlab","owner":"mtchavez","description":"Gitlab OAuth2 Strategy fo Überauth","archived":false,"fork":false,"pushed_at":"2022-01-10T19:45:53.000Z","size":150,"stargazers_count":7,"open_issues_count":6,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T12:46:43.691Z","etag":null,"topics":["elixir","elixir-oauth","gitlab","gitlab-oauth","ueberauth","ueberauth-gitlab","ueberauth-strategies"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtchavez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-06T01:02:57.000Z","updated_at":"2024-08-11T10:10:13.000Z","dependencies_parsed_at":"2022-08-07T15:16:01.859Z","dependency_job_id":null,"html_url":"https://github.com/mtchavez/ueberauth_gitlab","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fueberauth_gitlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fueberauth_gitlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fueberauth_gitlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fueberauth_gitlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtchavez","download_url":"https://codeload.github.com/mtchavez/ueberauth_gitlab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248265018,"owners_count":21074868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-oauth","gitlab","gitlab-oauth","ueberauth","ueberauth-gitlab","ueberauth-strategies"],"created_at":"2024-12-09T21:11:19.972Z","updated_at":"2025-04-12T18:26:10.196Z","avatar_url":"https://github.com/mtchavez.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Überauth Gitlab\n\n[![Hex Version](https://img.shields.io/hexpm/v/ueberauth_gitlab_strategy.svg)](https://hex.pm/packages/ueberauth_gitlab_strategy)\n[![Build Status](https://travis-ci.org/mtchavez/ueberauth_gitlab.svg?branch=master)](https://travis-ci.org/mtchavez/ueberauth_gitlab)\n[![Coverage Status](https://coveralls.io/repos/github/mtchavez/ueberauth_gitlab/badge.svg?branch=master)](https://coveralls.io/github/mtchavez/ueberauth_gitlab?branch=master)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ueberauth_gitlab_strategy/)\n\n\u003e Gitlab OAuth2 strategy for Überauth.\n\n## Installation\n\n1. Setup your application in Gitlab under your profile [applications menu][gitlab-apps]\n\n1. Add `:ueberauth_gitlab_strategy` to your list of dependencies in `mix.exs`:\n\n   ```elixir\n   def deps do\n     [{:ueberauth_gitlab_strategy, \"~\u003e 0.4\"}]\n   end\n   ```\n\n1. Add the strategy to your applications:\n\n   ```elixir\n   def application do\n     [applications: [:ueberauth_gitlab_strategy]]\n   end\n   ```\n\n1. Add Gitlab to your Überauth configuration:\n\n   ```elixir\n   config :ueberauth, Ueberauth,\n     providers: [\n       identity: { Ueberauth.Strategy.Identity, [\n           callback_methods: [\"POST\"],\n           uid_field: :email,\n           nickname_field: :username,\n         ] },\n       gitlab: {Ueberauth.Strategy.Gitlab, [default_scope: \"read_user\"]},\n     ]\n   ```\n\n1. Update your provider configuration:\n\n   ```elixir\n   config :ueberauth, Ueberauth.Strategy.Gitlab.OAuth,\n     client_id: System.get_env(\"GITLAB_CLIENT_ID\"),\n     client_secret: System.get_env(\"GITLAB_CLIENT_SECRET\"),\n     redirect_uri: System.get_env(\"GITLAB_REDIRECT_URI\")\n   ```\n\n1. Include the Überauth plug in your controller:\n\n   ```elixir\n   defmodule MyApp.AuthController do\n     use MyApp.Web, :controller\n\n     pipeline :browser do\n       plug Ueberauth\n       ...\n      end\n   end\n   ```\n\n1. Create the request and callback routes if you haven't already:\n\n   ```elixir\n   scope \"/auth\", MyApp do\n     pipe_through :browser\n\n     get \"/:provider\", AuthController, :request\n     get \"/:provider/callback\", AuthController, :callback\n   end\n   ```\n\n1. Your controller needs to implement callbacks to deal with `Ueberauth.Auth`\n   and `Ueberauth.Failure` responses.\n\nFor an example implementation see the [Überauth Example][example-app] application\non how to integrate other strategies. Adding Gitlab should be similar to Github.\n\n## Calling\n\nDepending on the configured url you can initial the request through:\n\n```text\n/auth/gitlab\n```\n\nOr with options:\n\n```text\n/auth/gitlab?scope=api read_user\n```\n\nConfiguration for adding Gitlab as Üeberauth Strategy\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    identity: { Ueberauth.Strategy.Identity, [\n        callback_methods: [\"POST\"],\n        uid_field: :email,\n        nickname_field: :username,\n      ] },\n    gitlab: {Ueberauth.Strategy.Gitlab, [default_scope: \"read_user\"]},\n  ]\n```\n\nIt is also possible to disable the sending of the `redirect_uri` to Gitlab. This\nis particularly useful when your production application sits behind a proxy that\nhandles SSL connections. In this case, the `redirect_uri` sent by `Ueberauth`\nwill start with `http` instead of `https`, and if you configured your Gitlb OAuth\napplication's callback URL to use HTTPS, Gitlab will throw an `uri_missmatch` error.\nIn addition if the `redirect_uri` on the the authorize request **must match**\nthe `redirect_uri` on the token request.\n\n## Documentation\n\nThe docs can be found at [ueberauth_gitlab][package-docs] on [Hex Docs][hex-docs].\n\n[example-app]: https://github.com/ueberauth/ueberauth_example\n[gitlab-apps]: https://gitlab.com/profile/applications\n[hex-docs]: https://hexdocs.pm\n[package-docs]: https://hexdocs.pm/ueberauth_gitlab_strategy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtchavez%2Fueberauth_gitlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtchavez%2Fueberauth_gitlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtchavez%2Fueberauth_gitlab/lists"}