PowAssent v0.1.0 PowAssent.Strategy.Github View Source

Github OAuth 2.0 strategy.

Usage

config :my_app, :pow_assent,
  providers: [
    github: [
      client_id: "REPLACE_WITH_CLIENT_ID",
      client_secret: "REPLACE_WITH_CLIENT_SECRET",
      strategy: PowAssent.Strategy.Github
    ]
  ]

Link to this section Summary

Link to this section Functions

Link to this function authorize_url(config, conn) View Source
authorize_url(Keyword.t(), Plug.Conn.t()) ::
  {:ok, %{conn: Plug.Conn.t(), state: binary(), url: binary()}}

Callback implementation for PowAssent.Strategy.authorize_url/2.

Link to this function callback(config, conn, params) View Source
callback(Keyword.t(), Plug.Conn.t(), map()) ::
  {:ok, %{conn: Plug.Conn.t(), user: map()}}
  | {:error, %{conn: Plug.Conn.t(), error: any()}}

Callback implementation for PowAssent.Strategy.callback/3.

Link to this function default_config(config) View Source
default_config(Keyword.t()) :: Keyword.t()

Callback implementation for PowAssent.Strategy.OAuth2.Base.default_config/1.

Link to this function get_user(config, token) View Source
get_user(Keyword.t(), map()) :: {:ok, map()} | {:error, any()}

Callback implementation for PowAssent.Strategy.OAuth2.Base.get_user/2.

Link to this function normalize(config, user) View Source
normalize(Keyword.t(), map()) :: {:ok, map()} | {:error, any()}

Callback implementation for PowAssent.Strategy.OAuth2.Base.normalize/2.