class Users \ UserOpenID


Allows users to be logged in with OpenID. Based on LightOpenID


Method Summary

Name Description
addIdentity(Connection $db, User $user, $openid, $redirect)
removeIdentity(Connection $db, User $user, $openid) Remove the given OpenID identity from the given user.
tryLogin(Connection $db, $openid, $redirect) Try logging in as a user with the given email and password.
trySignup(Connection $db, $email, $openid, $redirect)
validateOpenID($openid, $redirect) Try do OpenID validation (with the given redirect).

static function addIdentity(Connection $db, User $user, $openid, $redirect)

Returns:
the added OpenID identity
Throws:
UserSignupException - if the user could not be signed up, with a reason
UserAlreadyExistsException - if the identity already exists in the database

static function removeIdentity(Connection $db, User $user, $openid)

Remove the given OpenID identity from the given user.


static function tryLogin(Connection $db, $openid, $redirect)

Try logging in as a user with the given email and password.

Parameters:
$redirect - the registered redirect URI
Returns:
a valid User
Throws:
UserAuthenticationException - if the user could not be logged in, with a reason

static function trySignup(Connection $db, $email, $openid, $redirect)

Returns:
the created User
Throws:
UserSignupException - if the user could not be signed up, with a reason
UserAlreadyExistsException - if the identity or email already exists in the database

static function validateOpenID($openid, $redirect)

Try do OpenID validation (with the given redirect).

Returns:
the validated LightOpenID object on success
Throws:
UserSignupException - if anything bad happened