Rapid authentication for new Elixir projects.
Identity takes the best of Phoenix's mix phx.gen.auth
, combines the power of Ueberauth for OAuth, and adds additional features like multi-factor authentication.
It works to handle the logic of authentication so you can focus on more important parts of your app.
This includes:
Some of the additional nice-to-have features include:
All features are optional. Integrate what you want, and ignore the rest!
If you want to integrate Identity into an existing application, see Getting Started. If you want to quickly see what Identity can do, follow these abbreviated instructions:
mix phx.new
(learn more here).mix deps.get
:def deps do
[
{:identity, github: "aj-foster/identity", branch: "main"}
]
end
Identity.Migrations
).repo
option, for example config :identity, repo: MyApp.Repo
(see Identity.Config
).Identity.Controller
).:eqrcode
and :nimble_totp
to support 2FA.:bamboo
or :swoosh
to support email notifications and set the notifier
config accordingly.:ueberauth
and any desired Ueberauth providers to support OAuth.@import "../../deps/identity/priv/static/vanilla.css";
to app.css
to style the provided templates.Run your application with iex -S mix phx.server
and start at http://localhost:4000/user/new to create a new user and start using your Identity-enabled application.
With phx.gen.auth
, adding authentication to a new Phoenix application became much easier.
However, it still requires developers to understand, integrate, and maintain the code.
This can provide friction for projects looking to get off the ground quickly.
What if something is implemented incorrectly?
What if it's unsafe?
Identity's goal is to allow developers to get started quickly and also customize the experience when time allows later on. Through Progressive Replacement, Identity's out-of-the-box features can gradually be replaced with custom implementations as the application matures.
Identity is made to eventually be replaced, but only when the developer is ready.
This project uses, directly or indirectly, code from several other projects:
phx.gen.auth
: Copyright 2014 Chris McCord, released under the MIT LicenseThis project is licensed under the MIT License. For more information, see the LICENSE file.