Fluent builder for registering a custom Milton authentication handler backed by JS functions, reached from controllerMappings.authenticationHandler(). Set the JS function names for the Milton AuthenticationHandler contract (supports, authenticate, isCompatible, appendChallenges, credentialsPresent) and call build to create and register the handler.
Group: Builders
Methods
supports(String supportsFunc)
Returns: AuthHandlerBuilder
Sets the name of the JS function that decides whether this handler applies to a given resource and request, matching Milton's AuthenticationHandler.supports.
| Parameter | Description |
|---|---|
supportsFunc | name of the JS function to call; it receives the resource and the request and should return a boolean |
isCompatible(String isCompatibleFunc)
Returns: AuthHandlerBuilder
Sets the name of the JS function that decides whether this handler is compatible with a given resource and request, matching Milton's AuthenticationHandler.isCompatible.
| Parameter | Description |
|---|---|
isCompatibleFunc | name of the JS function to call; it receives the resource and the request and should return a boolean |
appendChallenges(String appendChallengesFunc)
Returns: AuthHandlerBuilder
Sets the name of the JS function that appends authentication challenges to the response, matching Milton's AuthenticationHandler.appendChallenges.
| Parameter | Description |
|---|---|
appendChallengesFunc | name of the JS function to call; it receives the resource, the request and the mutable list of challenge strings to append to |
credentialsPresent(String credentialsPresentFunc)
Returns: AuthHandlerBuilder
Sets the name of the JS function that decides whether the request carries credentials for this handler, matching Milton's AuthenticationHandler.credentialsPresent.
| Parameter | Description |
|---|---|
credentialsPresentFunc | name of the JS function to call; it receives the request and should return a boolean |
build()
Returns: JsAuthHandlerMapping
Builds the mapping of JS function names configured on this builder and, unless the app engine has already finished initialising, registers it so the resulting authentication handler is used for future requests.