AshAuthentication.BankID.Dsl (ash_authentication_bankid v0.1.3)

View Source

DSL entity definition for the BankID authentication strategy.

This module defines the configuration options available when setting up BankID authentication in your user resource.

Summary

Functions

Returns the Spark DSL entity for configuring BankID authentication.

Functions

dsl()

Returns the Spark DSL entity for configuring BankID authentication.

Configuration Options

  • :name - Unique identifier for this strategy (required, defaults to :bank_id)
  • :order_resource - The Ash resource that stores BankID orders (required)
  • :identity_field - Primary identity field for user lookup (default: :personal_number)
  • :personal_number_field - Field to store Swedish personal number (default: :personal_number)
  • :given_name_field - Field to store given name from BankID (default: :given_name)
  • :surname_field - Field to store surname from BankID (default: :surname)
  • :verified_at_field - Field to store verification timestamp (default: :bankid_verified_at)
  • :ip_address_field - Field to store IP address (default: :ip_address)
  • :sign_in_action_name - Name of the sign-in action (auto-generated if not provided)
  • :order_ttl - Order expiration time in seconds (default: 180)
  • :poll_interval - Recommended poll interval in milliseconds (default: 2000)

Example

authentication do
  strategies do
    bank_id do
      order_resource MyApp.Accounts.BankIDOrder
      personal_number_field :personal_number
      given_name_field :given_name
      surname_field :surname
      verified_at_field :bankid_verified_at
      order_ttl 180
    end
  end
end