View Source Charon.AuthChallenge.PasswordChallenge (Charon v0.0.4-alpha)

Auth challenge implementing a standard user password using a Comeonin-compatible hashing module. This challenge cannot be disabled for individual users, every user MUST have a password.

config

Config

Additional config is required for this module under optional.charon_password_challenge:

Charon.Config.from_enum(
  ...,
  optional_modules: %{
    charon_password_challenge: %{
      ...
    }
  }
)

The following configuration options are supported:

  • :new_password_param (optional, default "new_password"). The name of the param that contains the password (or new password).
  • :password_check (optional, default password_check/1). Predicate that checks new passwords.

Link to this section Summary

Functions

Callback implementation for Charon.AuthChallenge.name/0.

Returns true if the password has at least 8 characters.

Link to this section Functions

Link to this function

challenge_init(conn, params, user, config)

View Source

Callback implementation for Charon.AuthChallenge.challenge_init/4.

Callback implementation for Charon.AuthChallenge.name/0.

Link to this function

password_check(password)

View Source
@spec password_check(binary()) :: boolean()

Returns true if the password has at least 8 characters.

Link to this function

setup_init(conn, params, user, config)

View Source

Callback implementation for Charon.AuthChallenge.setup_init/4.