Class EmailVerificationConfigurer
The address a mailed verification link opens.
http.emailVerification(Customizer.withDefaults());
GET /verify-email?token=... is a page with one button, and pressing it --
a POST -- records the address as proved and sends the user to
/?verified; a link that is no longer good is answered 400. Opening the
link proves nothing by itself, because a mail gateway opens every link in a
mail before its reader does. The address is open to everyone: a link is
often opened on another device than the one that is signed in.
The application mails the link itself, where it takes the address, with
linkUrl() as where it leads:
verification.send(username, email, "https://example.com/verify-email");
The work is an EmailVerificationService's: the one given here, or the
application's bean of that type.
-
Method Summary
Modifier and TypeMethodDescriptionconfirmUrl(String confirmUrl) The path the link opens;/verify-emailunless set.voidinit(HttpSecurity http) Shares what other parts need to know; nothing by default.linkUrl()The whole address to giveEmailVerificationService.send(String, String, String): the server's address fromcn1.security.base-urland the path the link opens.service(EmailVerificationService service) What checks the link, in place of the application's bean.successUrl(String successUrl) Where the user is sent once the address is proved;/?verifiedunless set.Methods inherited from class SecurityConfigurer
configure, disable, getBuilder
-
Method Details
-
service
What checks the link, in place of the application's bean. -
confirmUrl
The path the link opens;/verify-emailunless set. -
successUrl
Where the user is sent once the address is proved;/?verifiedunless set. -
linkUrl
The whole address to give
EmailVerificationService.send(String, String, String): the server's address fromcn1.security.base-urland the path the link opens.Throws
IllegalStateException: the setting is missing
-
init
Description copied from class:SecurityConfigurerShares what other parts need to know; nothing by default.- Overrides:
initin classSecurityConfigurer
-