Form Auth Scheme (aka Form based Auth)
aah provides an easy to use form-based auth. Three steps are involved in making use of Form auth scheme -
- Implement
authc.Authenticator
to provide subject’s authentication info - Implement
authz.Authorizer
to provide subject’s roles and permissions - Configure form auth URLs as needed
Refer aah Form Auth example.
Table of Contents
Configuration
aah supports one or more form
auth schemes such as using datasource, Active Directory, REST APIs, etc.
Section: form_scheme_key { … }
form_scheme_key { ... }
configuration goes under section security.auth_schemes { ... }
.
Auto Semantic Route Configuration
Since v0.11.0 aah does auto semantic route configuration of route login submit
for all domains provided auth scheme form
is configured in it.
- aah scans
security.auth_schemes { ... }
to see whether auth schemeform
is configured for the domain - If configured, then aah automatically adds route
<auth-scheme-name>_login_submit__aah
to the domain - If user configures the route
<auth-scheme-name>_login_submit__aah
, then aah will not add it. In other words, it will be overridden - In view files, form action URL can be accessed as
{{ rurl . "<auth-scheme-name>_login_submit__aah" }}
Example Config: form_auth
Configuration from aah Form Auth example.
Auto Semantic route added as -
On view file, form action URL accessed as -