View Source ElixirAuthGithub (ElixirAuthGithub v1.6.2)

ElixirAuthGithub is an Elixir package that handles all your GitHub OAuth needs so you can add "Sign in with GitHub" to any Elixir/Phoenix App.

For all setup details, please see: https://github.com/dwyl/elixir-auth-github

Link to this section Summary

Functions

client_id/0 returns a String of the GITHUB_CLIENT_ID

client_secret/0 returns a String of the GITHUB_CLIENT_SECRET

When called with a valid OAuth callback code, github_auth/1 makes a number of authentication requests to GitHub and returns a tuple with :ok and a map with GitHub user details and an access_token.

inject_poison/0 injects a TestDouble of HTTPoison in Test so that we don't have duplicate mock in consuming apps. see: https://github.com/dwyl/elixir-auth-google/issues/35

login_url/0 returns a String URL to be used as the initial OAuth redirect.

Identical to login_url/0 except with an additional state and scope properties appended to the URL.

Link to this section Functions

client_id/0 returns a String of the GITHUB_CLIENT_ID

client_secret/0 returns a String of the GITHUB_CLIENT_SECRET

When called with a valid OAuth callback code, github_auth/1 makes a number of authentication requests to GitHub and returns a tuple with :ok and a map with GitHub user details and an access_token.

Bad authentication codes will return a tuple with :error and an error map.

inject_poison/0 injects a TestDouble of HTTPoison in Test so that we don't have duplicate mock in consuming apps. see: https://github.com/dwyl/elixir-auth-google/issues/35

login_url/0 returns a String URL to be used as the initial OAuth redirect.

Requires GITHUB_CLIENT_ID environment variable to be set. See step 2 of setup instructions.

Identical to login_url/0 except with an additional state and scope properties appended to the URL.