Nym (Nym v0.0.1-rc2)
View SourceIdentity provider and authentication layer.
Nym is a minimal IndieAuth implementation providing an authorization endpoint, which serves two purposes:
- decentralised authentication using personal domain names as identity, following the IndieAuth specification.
- centralised authentication layer for in-house applications (similar to OAuth or SSO).
This library provides a Nym client for easily protecting Phoenix-based applications with centralised identity management.
Usage
import Nym
pipeline :browser do
...
plug :fetch_session
plug :fetch_current_user
end
scope "/protected" do
pipe_through [:browser, :require_auth]
get "/", PageController, :index
live_session :default, on_mount: Nym do
live "/hello", WorldLive, :hello
end
end
Summary
Types
Functions
@spec fetch_current_user(Plug.Conn.t(), opts()) :: Plug.Conn.t()
@spec require_auth(Plug.Conn.t(), opts()) :: Plug.Conn.t()
@spec require_auth(Plug.Conn.t(), opts()) :: Plug.Conn.t()