PhoenixOauth2Provider v0.1.0 PhoenixOauth2Provider.Router

Handles routing for PhoenixOauth2Provider.

Usage

Configure lib/my_project/web/router.ex the following way:

defmodule MyProject.Router do
  use MyProject.Web, :router
  use PhoenixOauth2Provider.Router

  pipeline :oauth_public do
    plug :put_secure_browser_headers
  end

  pipeline :protected do
    # Require user authentication
  end

  scope "/", MyProject.Web do
    pipe_through :oauth_public
    oauth_routes :public
  end

  scope "/", MyProject.Web do
    pipe_through :protected
    oauth_routes :protected
  end

  ...
end

Summary

Functions

PhoenixOauth2Provider router macro. Use this macro to define the PhoenixOauth2Provider routes

Functions

oauth_routes(mode, options \\ %{}) (macro)

PhoenixOauth2Provider router macro. Use this macro to define the PhoenixOauth2Provider routes.

Examples:

# Routes that are public with no CSRF protection
scope "/" do
  pipe_through :public
  oauth_routes :public
end

# Routes requires authentication
scope "/" do
  pipe_through :protected
  oauth_routes :protected
end