mix ash_authentication.add_strategy.oauth2 (ash_authentication v5.0.0-rc.7)

Copy Markdown View Source

Adds a generic OAuth2 authentication strategy to your user resource

Unlike OIDC, generic OAuth2 does not auto-discover provider endpoints. You can provide the URLs via CLI flags (set as literals in the DSL) or leave them to be configured via environment variables.

Example

mix ash_authentication.add_strategy oauth2 my_provider

Options

  • --user, -u - The user resource. Defaults to YourApp.Accounts.User
  • --accounts, -a - The accounts domain. Defaults to YourApp.Accounts
  • --identity-field, -i - The field used to identify the user. Defaults to email
  • --base-url - Base URL of the OAuth2 provider
  • --authorize-url - Authorization endpoint URL (relative to base_url or absolute)
  • --token-url - Token endpoint URL (relative to base_url or absolute)
  • --user-url - User info endpoint URL (relative to base_url or absolute)

Summary

Functions

igniter(igniter)

Callback implementation for Igniter.Mix.Task.igniter/1.