View Source Oidcc.Authorization (Oidcc v3.2.6)

Functions to start an OpenID Connect Authorization

Telemetry

  • [:oidcc, :par_request, :start]

    • Description: Emitted at the start of executing a PAR request
    • Measurements: %{system_time: non_neg_integer(), monotonic_time: integer()}
    • Metadata: %{issuer: :uri_string.uri_string(), client_id: String.t()}
  • [:oidcc, :par_request, :stop]

    • Description: Emitted at the end of executing a PAR request
    • Measurements: %{duration: integer(), monotonic_time: integer()}
    • Metadata: %{issuer: :uri_string.uri_string(), client_id: String.t()}
  • [:oidcc, :par_request, :exception]

    • Description: Emitted at the end of executing a PAR request
    • Measurements: %{duration: integer(), monotonic_time: integer()}
    • Metadata: %{issuer: :uri_string.uri_string(), client_id: String.t()}

Summary

Functions

Link to this function

create_redirect_url(client_context, opts)

View Source (since 3.0.0)
@spec create_redirect_url(
  client_context :: Oidcc.ClientContext.t(),
  opts :: :oidcc_authorization.opts()
) :: {:ok, :uri_string.uri_string()} | {:error, :oidcc_authorization.error()}

Create Auth Redirect URL

For a high level interface using Oidcc.ProviderConfiguration.Worker see Oidcc.create_redirect_url/4.

Examples

iex> {:ok, pid} =
...>   Oidcc.ProviderConfiguration.Worker.start_link(%{
...>     issuer: "https://accounts.google.com"
...>   })
...>
...> {:ok, client_context} =
...>   Oidcc.ClientContext.from_configuration_worker(
...>     pid,
...>     "client_id",
...>     "client_secret"
...>   )
...>
...> {:ok, _redirect_uri} =
...>   Oidcc.Authorization.create_redirect_url(
...>     client_context,
...>     %{redirect_uri: "https://my.server/return"}
...>   )