plugoid v0.1.0 API Reference

Modules

Basic use

defmodule MyAppWeb.Router do
  use MyAppWeb, :router
  use Plugoid.RedirectURI

  pipeline :oidc_auth do
    plug Plugoid,
      issuer: "https://repentant-brief-fishingcat.gigalixirapp.com",
      client_id: "client1",
      client_config: PlugoidDemo.OpenIDConnect.Client
  end

  scope "/private", MyAppWeb do
    pipe_through :browser
    pipe_through :oidc_auth

    get "/", PageController, :index
    post "/", PageController, :index
  end
end

Plug options

Mandatory plug options

  • :client_id [Mandatory]: the client id to be used for interaction with the OpenID Provider (OP)
  • :client_config [Mandatory]: a module that implements the OIDC.ClientConfig behaviour and returns the client configuration
  • :issuer [Mandatory]: the OpenID Provider (OP) issuer. Server metadata and keys are automatically retrieved from it if the OP supports it

Additional plug options

  • :acr_values: one of

Plug to configure the application redirect URI