OpenID Connect Plug for Phoenix
Plugoid lets you protect some routes with OpenID Connect authentication, for instance:
defmodule PlugoidDemoWeb.Router do
use PlugoidDemoWeb, :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", PlugoidDemoWeb do
pipe_through :browser
pipe_through :oidc_auth
get "/", PageController, :index
post "/", PageController, :index
end
end
plugoid_demo
: a demo application using Plugoid
def deps do
[
{:plugoid, "~> 0.6.0"},
{:hackney, "~> 1.0"}
]
end
The hackney dependency is used as the default adapter for Tesla (for outbound HTTP requests).
Another one can be used instead (see
https://github.com/teamon/tesla#adapters) and then
has to be configured in your config.exs
:
config :tesla, adapter: Tesla.Adapter.AnotherOne
Possible uses are:
The implementation of the standard is comprehsensive but as for all security related libraries, care should be taken when assessing it. This library is not (yet?) widely used and has received little scrutiny by other programmers or security specialists.
This project is also looking for contributors. Feel free to take a look at issues opened in the following projects:
"code"
response type"id_token"
response type"id_token token"
response type"code id_token"
response type"code token"
response type"code id_token token"
response typeOAuth2TokenManager
)"acr"
"auth_time"
TeslaOAuth2ClientAuth
)"client_secret_basic"
"client_secret_post"
"client_secret_jwt"
"private_key_jwt"
"none"
OAuth2TokenManager
)