FormAuthenticationMechanismDefinition

The FormAuthenticationMechanismDefinition will present the user with a web form for credentials. We can specify the login page to be displayed for user authentication, as well as an error page, in case an error arises. Alternatively, default pages can be used. The following code is an example of this:

@FormAuthenticationMechanismDefinition(
loginToContinue = LoginToContinue(
loginPage = "/login.html",
errorPage = "/error.html"))
@ApplicationScoped
class ApplicationConfig : Application() {
override fun getClasses(): Set<Class<*>> {
val classes = HashSet<Class<*>>()
classes.add(Controller::class.java)
return classes
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset