<h1>Why Rodauth?</h1>

<p>Rodauth is Ruby's most advanced authentication framework.   There are other authentication frameworks for Ruby, such as <a href="https://github.com/heartcombo/devise">Devise</a>, <a href="https://github.com/binarylogic/authlogic">Authlogic</a>, and <a href="https://github.com/NoamB/sorcery">Sorcery</a>, but all of them are Rails-specific.  Rodauth offers many advantages over competing frameworks:</p>

<ul>
<li>Rodauth works with any rack application, not just Rails. It can run as a rack middleware on non-Roda applications. It can also be used as a library in non-web applications.</li>
<li>Rodauth uses a more secure password hash storage model that cannot leak password hashes without a privilege escalation attack on the database.</li>
<li>Rodauth ships with support for multiple multifactor authentication methods.</li>
<li>Rodauth ships with support for multiple passwordless authentication methods.</li>
<li>Rodauth ships with a JSON API for all features.</li>
<li>Rodauth supports overriding of almost all behavior on a per-request basis using a simple DSL.</li>
</ul>

<h2>Goals</h2>

<ul>
  <li>Security</li>
  <li>Simplicity</li>
  <li>Flexibility</li>
</ul>

<h3>Security</h3>

<p>Rodauth ships in a maximum security by default configuration.  The default and recommended way to use Rodauth is with multiple database accounts and using database functions for authentication, in order to protect access to password hashes from attackers.  Even if you are storing nothing else important in your application, if you are storing password hashes, it is critical that you protect access to them as much as possible, so that an attacker will not be able to use the password hashes stored in your database to attack other sites.  However, if you are not able to use this more secure mode, Rodauth also supports more typical methods of password storage.</p>

<p>Rodauth ships with support for multiple multifactor authentication methods including WebAuthn and TOTP, protecting your site from password hash attacks on other sites.</p>

<p>Rodauth ships with support for multiple passwordless authentication methods, allowing users to login without having passwords at all.</p>

<p>For tokens stored in the database (e.g. for resetting passwords), Rodauth can use an HMAC such that an SQL injection vulnerability in the application to leak the tokens will result in unusable tokens unless the application's HMAC secret is also compromised.</p>

<h3>Simplicity</h3>

<p>Rodauth uses a simple configuration DSL that allows easily constructing a custom authentication object designed for your application.</p>

<h3>Flexibility</h3>

<p>Rodauth allows for overriding any part of the framework on a per-request basis using any information related to the request, by passing a block to any configuration method.</p>

<h2>Full Featured</h2>

<p>Rodauth ships with support for a large amount of authentication features, such as:</p>

<ul>
  <li>Login</li>
  <li>Logout</li>
  <li>Change Password</li>
  <li>Change Login</li>
  <li>Reset Password</li>
  <li>Create Account</li>
  <li>Close Account</li>
  <li>Verify Account</li>
  <li>Remember (Autologin via token)</li>
  <li>Lockout (Bruteforce protection)</li>
  <li>Audit Logging</li>
  <li>Email Authentication (Passwordless login via email link)</li>
  <li>WebAuthn (Multifactor authentication via WebAuthn)</li>
  <li>WebAuthn Login (Passwordless login via WebAuthn)</li>
  <li>WebAuthn Verify Account (Passwordless WebAuthn Setup)</li>
  <li>WebAuthn Autofill (Autofill WebAuthn credentials on login)</li>
  <li>WebAuthn Modify Email (Email when WebAuthn authenticator added or removed)</li>
  <li>OTP (Multifactor authentication via TOTP)</li>
  <li>OTP Modify Email (Email when TOTP authentication setup or disabled)</li>
  <li>OTP Unlock (Unlock TOTP authentication after lockout)</li>
  <li>OTP Lockout Email (Email when TOTP authentication locked out or unlocked)</li>
  <li>Recovery Codes (Multifactor authentication via backup codes)</li>
  <li>SMS Codes (Multifactor authentication via SMS)</li>
  <li>Verify Login Change (Reverify accounts after login changes)</li>
  <li>Verify Account Grace Period (Don't require verification before login)</li>
  <li>Password Grace Period (Don't require password entry if recently entered)</li>
  <li>Password Complexity (More sophisticated checks)</li>
  <li>Password Pepper (Appends secret to password before hashing)</li>
  <li>Change Password Notify (Notify user about password changes)</li>
  <li>Reset Password Notify (Notify user about completed password resets)</li>
  <li>Confirm Password (Ask user to enter password if logged in via a token)</li>
  <li>Update Password Hash (If changing password hash cost)</li>
  <li>Argon2 (Alternative Password hash algorithm)</li>
  <li>Disallow Common Passwords</li>
  <li>Disallow Password Reuse</li>
  <li>Password Expiration</li>
  <li>Account Expiration</li>
  <li>Session Expiration</li>
  <li>Active Sessions (Prevent session reuse after logout, allow logout of all sessions)</li>
  <li>Single Session (Only one active session per account)</li>
  <li>HTTP Basic Auth</li>
  <li>JSON (JSON API support for all other features)</li>
  <li>JWT (JSON Web Token support for all other features)</li>
  <li>JWT CORS (Cross-Origin Resource Sharing)</li>
  <li>JWT Refresh (Access &amp; refresh tokens)</li>
  <li>Internal Request (Interact with Rodauth via methods)</li>
  <li>Path Class Methods (Get paths/URLs for features via class methods)</li>
</ul>

<p style="margin-top: 20px;">You can learn more about these features by reviewing <a href="documentation.html">Rodauth's documentation</a>.</p>
