November 2018
Intermediate to advanced
388 pages
9h 5m
English
BasicAuthenticationMechanismDefinition will trigger the browser of the client to prompt for a username and password, which maps to the HTTP basic authentication mechanism that isn't very widely used any more. The following code is an example of this:
@BasicAuthenticationMechanismDefinition( realmName = "top-level-realm")@ApplicationScopedclass ApplicationConfig : Application() { override fun getClasses(): Set<Class<*>> { val classes = HashSet<Class<*>>() classes.add(Controller::class.java) return classes }}
The request has to specify the user ID and password in Base 64-encoded format, such as Basic {{userId:secret}}. It must then pass it to the authorization header.
Read now
Unlock full access