Class FormLoginExtension
java.lang.Object
dev.relism.flash.ext.security.form.FormLoginExtension
- All Implemented Interfaces:
dev.relism.flash.extension.FlashExtension
public final class FormLoginExtension
extends Object
implements dev.relism.flash.extension.FlashExtension
Password sign-in:
POST /auth/form/login with username and password
form-encoded — what an HTML form sends, and what fetch sends given URLSearchParams.
Success starts a session and answers 303 to redirect (same-origin paths only) or
/; failure is a 401, identical for an unknown account and a wrong password.
app.install(new SecurityExtension())
.install(new FormLoginExtension(accounts::byUsername));
Rate-limit the route with flash-ext-limiter; this extension does not.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(dev.relism.flash.extension.FlashRegistrar<?> app, dev.relism.flash.extension.FlashContext ctx) passwordEncoder(PasswordEncoder encoder)
-
Field Details
-
LOGIN
- See Also:
-
-
Constructor Details
-
FormLoginExtension
-
-
Method Details
-
passwordEncoder
-
configure
public void configure(dev.relism.flash.extension.FlashRegistrar<?> app, dev.relism.flash.extension.FlashContext ctx) - Specified by:
configurein interfacedev.relism.flash.extension.FlashExtension
-