View Source Oidcc.Plug.ValidateJwtToken (Oidcc Plug v0.1.2)
Validate extracted authorization token by validating it as a JWT token.
This module should be used together with Oidcc.Plug.ExtractAuthorization
.
defmodule SampleAppWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :sample_app
# ...
plug Oidcc.Plug.ExtractAuthorization
plug Oidcc.Plug.ValidateJwtToken,
provider: SampleApp.GoogleOpenIdConfigurationProvider,
client_id: Application.compile_env!(:sample_app, [Oidcc.Plug.ValidateJwtToken, :client_id]),
client_secret: Application.compile_env!(:sample_app, [Oidcc.Plug.ValidateJwtToken, :client_secret])
plug SampleAppWeb.Router
end
Summary
Types
@type opts() :: [ provider: GenServer.name(), client_id: String.t() | (-> String.t()), client_secret: String.t() | (-> String.t()), send_inactive_token_response: (conn :: Plug.Conn.t() -> Plug.Conn.t()) ]
Plug Configuration Options
Options
provider
- name of theOidcc.ProviderConfiguration.Worker
client_id
- OAuth Client ID to use for the token validationclient_secret
- OAuth Client Secret to use for the token validationsend_inactive_token_response
- Customize Error Response for inactive token