Provides access to the OneAuth configuration.
Configuration values are read from the application environment and exposed through a small, typed API.
OneAuth is typically configured in config/runtime.exs:
config :one_auth,
username: System.fetch_env!("ONE_AUTH_USERNAME"),
password: System.fetch_env!("ONE_AUTH_PASSWORD"),
signing_secret: System.fetch_env!("ONE_AUTH_SIGNING_SECRET")See the Configuration Guide for all available options, recommended configuration, and environment variable examples.
See also
Summary
Functions
Returns the configured login path.
Returns the default destination after a successful login.
Returns the maximum session lifetime in milliseconds.
Returns the configured password.
Returns the configured signing secret.
Returns the configured username.
Functions
@spec login_path() :: String.t()
Returns the configured login path.
Unauthenticated requests are redirected to this path by
OneAuth.Plug.RequireAuth.
@spec login_redirect_path() :: String.t()
Returns the default destination after a successful login.
This value is used by OneAuth.login_redirect_path/1 when the login request
does not include a valid redirect_to query parameter.
@spec max_session_age() :: pos_integer()
Returns the maximum session lifetime in milliseconds.
The default is 24 hours.
@spec password() :: String.t()
Returns the configured password.
Raises an ArgumentError if no password has been configured.
@spec signing_secret() :: String.t()
Returns the configured signing secret.
The signing secret is used to sign and verify OneAuth session tokens.
Raises an ArgumentError if no signing secret has been configured.
@spec username() :: String.t()
Returns the configured username.
Raises an ArgumentError if no username has been configured.