authentication_hook(+Request, +Application, -User) is semidet[multifile, library(pengines)]
This hook is called from the =/pengine/create= HTTP handler to discover whether the server is accessed by an authorized user. It can react in three ways:
  • Succeed, binding User to a ground term. The authentity of the user is available through pengine_user/1.
  • Fail. The =/create= succeeds, but the pengine is not associated with a user.
  • Throw an exception to prevent creation of the pengine. Two meaningful exceptions are:
    • throw(http_reply(authorise(basic(Realm)))) Start a normal HTTP login challenge (reply 401)
    • throw(http_reply(forbidden(Path)))) Reject the request using a 403 repply.
See also
- http_authenticate/3 can be used to implement this hook using default HTTP authentication data.
 pengines:authentication_hook(+Request, +Application, -User)[multifile, library(swish/authenticate)]
Is called from the /pengine/create request to establish the logged in user.