public function authenticate(IdentityProvider $identityProvider)
    {
        try {
            // Authenticate the user.
            $identityProvider->authenticate();
            // Success!
            $this->isAuthenticated = true;
            // Set the data obtained from the identity provider.
            $this->name = $identityProvider->getUserName();
            $this->email = $identityProvider->getUserEmail();
        } catch (IdentityException $exception) {
            $this->isAuthenticated = false;
            throw $exception;
        }
    }
public function authenticate(IdentityProvider $identityProvider)
    {
        try {
            // Authenticate the user.
            $identityProvider->authenticate();
            // Success!
            $this->isAuthenticated = true;
            // Set the data obtained from the identity provider.
            $this->name = $identityProvider->getUserName();
            $this->email = $identityProvider->getUserEmail();
        } catch (IdentityException $exception) {
            $this->isAuthenticated = false;
            throw $exception;
        }
    }
public function authenticate ( IdentityProvider $ identityProvider ) { try { // Authenticate the user. $ identityProvider -> authenticate ( ) ; // Success! $ this -> isAuthenticated = true ; // Set the data obtained from the identity provider. $ this -> name = $ identityProvider -> getUserName ( ) ; $ this -> email = $ identityProvider -> getUserEmail ( ) ; } catch ( IdentityException $ exception ) { $ this -> isAuthenticated = false ; throw $ exception ; } }
Authenticates a user against an identity provider.

@param IdentityProvider $identityProvider
Authenticates a user against an identity provider .