Class FormLoginConfigurer
java.lang.Object
com.codename1.backend.security.SecurityConfigurer
com.codename1.backend.security.FormLoginConfigurer
Sign-in through an HTML form.
http.formLogin(form -> form
.loginPage("/signin")
.defaultSuccessUrl("/home")
.permitAll());
With nothing set, the chain serves a plain login page at GET /login, takes
the form at POST /login with the fields username and password, sends a
signed-in user back to the page that asked -- or to / -- and a refused one
to /login?error. Naming a loginPage hands the page to the application:
the chain then serves none, and takes the form at that same path.
-
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(HttpSecurity http) Adds this part's filters; nothing by default.defaultSuccessUrl(String defaultSuccessUrl) Where a user goes after signing in when no page asked for the sign-in.defaultSuccessUrl(String defaultSuccessUrl, boolean alwaysUse) failureHandler(AuthenticationFailureHandler failureHandler) Answers a refused sign-in itself, instead of the redirect.failureUrl(String failureUrl) Where a refused sign-in goes; the login page with?errorunless set.voidinit(HttpSecurity http) Shares what other parts need to know; nothing by default.The application's own login page: a path the application serves.loginProcessingUrl(String loginProcessingUrl) Where the form is posted; the login page's path unless set.passwordParameter(String passwordParameter) Lets everyone reach the login page, the form's target and the failure page, whatever the authorization rules say.successHandler(AuthenticationSuccessHandler successHandler) Answers a sign-in itself, instead of the redirects.usernameParameter(String usernameParameter) Methods inherited from class SecurityConfigurer
disable, getBuilder
-
Method Details
-
loginPage
The application's own login page: a path the application serves. -
loginProcessingUrl
Where the form is posted; the login page's path unless set. -
usernameParameter
-
passwordParameter
-
defaultSuccessUrl
Where a user goes after signing in when no page asked for the sign-in. -
defaultSuccessUrl
- Parameters:
alwaysUse- go there even when a page asked for the sign-in
-
failureUrl
Where a refused sign-in goes; the login page with?errorunless set. -
successHandler
Answers a sign-in itself, instead of the redirects. -
failureHandler
Answers a refused sign-in itself, instead of the redirect. -
permitAll
Lets everyone reach the login page, the form's target and the failure page, whatever the authorization rules say. Needed with aloginPageof the application's: without itanyRequest().authenticated()redirects the login page to itself. -
init
Description copied from class:SecurityConfigurerShares what other parts need to know; nothing by default.- Overrides:
initin classSecurityConfigurer
-
configure
Description copied from class:SecurityConfigurerAdds this part's filters; nothing by default.- Overrides:
configurein classSecurityConfigurer
-