Authenticate a principal using its openid
Authenticate a principal using its openid
The future this function return might fail if the openid authentication process fails at retrieving the redirect URL. You should handle this failure properly.
Authenticate a principal using its username and password
Authenticate a principal using its username and password
When the authentication try is evaluated the res function is called with either the now authenticated Principal or None.
authenticator.authenticateWithPassword("user", "password") { case Some(princ) ¬ヌメ Future.successful((true, Ok("You are now logged in."))) case None ¬ヌメ Future.successful((false, Ok("Authentication failure."))) }
The boolean return value of res can be used to prevent a login even though the credentials are correct which might be of use for deactivating accounts.
Callback for openid
Callback for openid
If the openID is valid and a principal is found a Some[Principal] and Some[String] (the valid openID) is passed to res. If the openID is valid but no principal can be found None and Some[String] is passed to res. If the openID is invalid None and None is passed to res. The third parameter contains a map of the exchange attributes.
The boolean return value of res can be used to prevent a login even though the credentials are correct.
When the principal is not existing but the openID is valid res should trigger some kind of application specific registration process.
Get the currently authed principal
Controller to retrieve, save, and create principals
Controller to retrieve, save, and create principals
This controller is used to manage creation of principal objects.
Unauthenticate a principal