View Source Oidcc.Plug.Authorize (Oidcc Plug v0.1.1)
Initiate Code Flow Authorization Redirect
defmodule SampleAppWeb.Router do
use Phoenix.Router
# ...
forward "/oidcc/authorize", to: Oidcc.Plug.Authorize,
init_opts: [
provider: SampleApp.GoogleOpenIdConfigurationProvider,
client_id: Application.compile_env!(:sample_app, [Oidcc.Plug.Authorize, :client_id]),
client_secret: Application.compile_env!(:sample_app, [Oidcc.Plug.Authorize, :client_secret]),
redirect_uri: "https://localhost:4000/oidcc/callback"
]
end
query-params
Query Params
state
- STate to relay to OpenID Provider. Commonly used for target redirect URL after authorization.
Link to this section Summary
Link to this section Types
@type opts() :: [ scopes: :oidcc_scope.scopes(), redirect_uri: String.t() | (-> String.t()), url_extension: :oidcc_http_util.query_params(), provider: GenServer.name(), client_id: String.t() | (-> String.t()), client_secret: String.t() | (-> String.t()) ]
Plug Configuration Options
options
Options
scopes
- scopes to requestredirect_uri
- Where to redirect for callbackurl_extension
- Custom query parameters to add to the redirect URIprovider
- name of theOidcc.ProviderConfiguration.Worker
client_id
- OAuth Client ID to use for the introspectionclient_secret
- OAuth Client Secret to use for the introspection