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.

ParameterDescription
supportsFuncname 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.

ParameterDescription
isCompatibleFuncname 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.

ParameterDescription
appendChallengesFuncname 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.

ParameterDescription
credentialsPresentFuncname 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.