phoenix_client_ssl v0.3.0 PhoenixClientSsl.Plug.ExtractEmailAddress

This Plug extracts the emailAddress of a certificate in eligible connections.

Best used together with PhoenixClientSsl.Plug.ExtractClientCertificate.

Installation

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

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

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

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

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

    get "/", SomeController, :index
  end
end

Link to this section Summary

Functions

Extract the emailAddress of a certificate in eligible connections

No configuration needed

Link to this section Functions

Link to this function call(conn, options)

Extract the emailAddress of a certificate in eligible connections.

Skipping if either the email address is already set or the connection has no client certificate.

No configuration needed.