phoenix_client_ssl v0.2.0 PhoenixClientSsl.Plug.AddClientCertificateToAbsintheContext

This Plug extracts the TLS Client Certificate CN from eligible connections and adds it to the absinthe context.

Best used together with PhoenixClientSsl.Plug.ExtractClientCertificate and PhoenixClientSsl.Plug.ExtractCommonName.

Installation

The plug can be installed in any pipeline of the Phoenix Router. It takes no options.

defmodule Acme.Web.Router do
  use Acme.Web, :router

  pipeline :api do
    plug :accepts, ["json"]

    # This line enables the plug
    plug PhoenixClientSsl.Plug.AddClientCertificateToAbsintheContext
  end

  scope "/", Acme.Web do
    pipe_through :api

    get "/", SomeController, :index
  end
end

Link to this section Summary

Functions

Add common name of a certificate to Absinthe context

No configuration needed

Link to this section Functions

Link to this function call(conn, options)

Add common name of a certificate to Absinthe context.

No configuration needed.