November 2018
Intermediate to advanced
388 pages
9h 5m
English
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"))@ApplicationScopedclass ApplicationConfig : Application() { override fun getClasses(): Set<Class<*>> { val classes = HashSet<Class<*>>() classes.add(Controller::class.java) return classes }}
Read now
Unlock full access