mix ash_authentication_bankid.install (ash_authentication_bankid v0.1.3)

View Source

Installs BankID authentication into a Phoenix application using Ash Authentication.

Usage

mix ash_authentication_bankid.install

Options

  • --user, -u - The user resource module (default: auto-detected from AshAuthentication)
  • --domain, -d - The Ash domain module (default: auto-detected from user resource)
  • --web-module, -w - The Phoenix web module (default: YourAppWeb)

What this installer does

  1. Adds BankID attributes to your User resource (personal_number, given_name, surname, etc.)
  2. Configures the BankID authentication strategy
  3. Creates a BankIDOrder resource for tracking authentication sessions
  4. Creates a BankIDLive LiveView for the authentication UI
  5. Creates an AuthCallbackController for session management
  6. Adds necessary routes to your router
  7. Ensures the email field allows nil (BankID doesn't provide emails)
  8. Generates database migrations

After installation

Run the following commands:

mix deps.get
mix ash.codegen
mix ecto.migrate

Then start your server and visit:

http://localhost:4000/auth/user/bank_id