{"id":13507447,"url":"https://github.com/ueberauth/ueberauth_github","last_synced_at":"2025-03-30T08:30:32.670Z","repository":{"id":47003194,"uuid":"46233091","full_name":"ueberauth/ueberauth_github","owner":"ueberauth","description":"GitHub OAuth2 Strategy for Überauth","archived":false,"fork":false,"pushed_at":"2023-05-27T21:19:02.000Z","size":82,"stargazers_count":102,"open_issues_count":2,"forks_count":54,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-09T16:45:23.104Z","etag":null,"topics":["github","oauth","oauth2","strategy","ueberauth","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ueberauth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-15T19:50:08.000Z","updated_at":"2024-09-25T08:15:40.000Z","dependencies_parsed_at":"2024-05-01T15:27:42.120Z","dependency_job_id":"f6636020-87dc-4274-b59d-f6f82245375c","html_url":"https://github.com/ueberauth/ueberauth_github","commit_stats":{"total_commits":70,"total_committers":30,"mean_commits":"2.3333333333333335","dds":0.8428571428571429,"last_synced_commit":"8b96898d9fd94c03f5d8a5cd3d86d961dd3a0b0f"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ueberauth","download_url":"https://codeload.github.com/ueberauth/ueberauth_github/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296374,"owners_count":20754625,"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":["github","oauth","oauth2","strategy","ueberauth","ueberauth-strategies"],"created_at":"2024-08-01T02:00:33.866Z","updated_at":"2025-03-30T08:30:32.252Z","avatar_url":"https://github.com/ueberauth.png","language":"Elixir","readme":"# Überauth GitHub\n\n[![Build Status](https://travis-ci.org/ueberauth/ueberauth_github.svg?branch=master)](https://travis-ci.org/ueberauth/ueberauth_github)\n[![Module Version](https://img.shields.io/hexpm/v/ueberauth_github.svg)](https://hex.pm/packages/ueberauth_github)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ueberauth_github/)\n[![Total Download](https://img.shields.io/hexpm/dt/ueberauth_github.svg)](https://hex.pm/packages/ueberauth_github)\n[![License](https://img.shields.io/hexpm/l/ueberauth_github.svg)](https://github.com/ueberauth/ueberauth_github/blob/master/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/ueberauth/ueberauth_github.svg)](https://github.com/ueberauth/ueberauth_github/commits/master)\n\n\u003e GitHub OAuth2 strategy for Überauth.\n\n## Installation\n\n1.  Setup your application at [GitHub Developer](https://developer.github.com).\n\n2.  Add `:ueberauth_github` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      [\n        {:ueberauth_github, \"~\u003e 0.8\"}\n      ]\n    end\n    ```\n\n3.  Add GitHub to your Überauth configuration:\n\n    ```elixir\n    config :ueberauth, Ueberauth,\n      providers: [\n        github: {Ueberauth.Strategy.Github, []}\n      ]\n    ```\n\n4.  Update your provider configuration:\n\n    ```elixir\n    config :ueberauth, Ueberauth.Strategy.Github.OAuth,\n      client_id: System.get_env(\"GITHUB_CLIENT_ID\"),\n      client_secret: System.get_env(\"GITHUB_CLIENT_SECRET\")\n    ```\n\n    Or, to read the client credentials at runtime:\n\n    ```elixir\n    config :ueberauth, Ueberauth.Strategy.Github.OAuth,\n      client_id: {:system, \"GITHUB_CLIENT_ID\"},\n      client_secret: {:system, \"GITHUB_CLIENT_SECRET\"}\n    ```\n\n5.  Include the Überauth plug in your router:\n\n    ```elixir\n    defmodule MyApp.Router do\n      use MyApp.Web, :router\n\n      pipeline :browser do\n        plug Ueberauth\n        ...\n       end\n    end\n    ```\n\n6.  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\n7.  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](https://github.com/ueberauth/ueberauth_example) application.\n\n## Calling\n\nDepending on the configured url you can initiate the request through:\n\n    /auth/github\n\nOr with options:\n\n    /auth/github?scope=user,public_repo\n\nBy default the requested scope is `\"user,public\\_repo\"`. This provides both read\nand write access to the GitHub user profile details and public repos. For a\nread-only scope, either use `\"user:email\"` or an empty scope `\"\"`. Empty scope\nwill only request minimum public information which even excludes user's email address\nwhich results in a `nil` for `email` inside returned `%Ueberauth.Auth.Info{}`.\nSee more at [GitHub's OAuth Documentation](https://developer.github.com/apps/building-integrations/setting-up-and-registering-oauth-apps/about-scopes-for-oauth-apps/).\n\nScope can be configured either explicitly as a `scope` query value on the\nrequest path or in your configuration:\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    github: {Ueberauth.Strategy.Github, [default_scope: \"user,public_repo,notifications\"]}\n  ]\n```\n\nIt is also possible to disable the sending of the `redirect_uri` to GitHub.\nThis is particularly useful when your production application sits behind a\nproxy that handles SSL connections. In this case, the `redirect_uri` sent by\n`Ueberauth` will start with `http` instead of `https`, and if you configured\nyour GitHub OAuth application's callback URL to use HTTPS, GitHub will throw an\n`uri_mismatch` error.\n\nTo prevent `Ueberauth` from sending the `redirect_uri`, you should add the\nfollowing to your configuration:\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    github: {Ueberauth.Strategy.Github, [send_redirect_uri: false]}\n  ]\n```\n\n## Private Emails\n\nGitHub now allows you to keep your email address private. If you don't mind\nthat you won't know a users email address you can specify\n`allow_private_emails`. This will set the users email as\n`id+username@users.noreply.github.com`.\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    github: {Ueberauth.Strategy.Github, [allow_private_emails: true]}\n  ]\n```\n\n## Copyright and License\n\nCopyright (c) 2015 Daniel Neighman\n\nThis library is released under the MIT License. See the [LICENSE.md](./LICENSE.md) file\n","funding_links":[],"categories":["Authentication"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fueberauth_github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fueberauth%2Fueberauth_github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fueberauth_github/lists"}