OAuth/UserProvider.php
protected function createIdentity( User $user, UserResponseInterface $response )
    {
        $identity = new $this->userIdentityClass;
        $identity->setAccessToken( $this->getAccessToken( $response ));
        $identity->setIdentifier( $response->getUsername() );
        $identity->setType( $response->getResourceOwner()->getName() );
        $identity->setUser( $user );
        $identity->setName( $this->getRealName( $response ));
        $identity->setEmail( $this->getEmail( $response ));
        $this->om->persist( $identity );
        $this->om->flush();
        return $identity;
    }
protected function createIdentity( User $user, UserResponseInterface $response )
    {
        $identity = new $this->userIdentityClass;
        $identity->setAccessToken( $this->getAccessToken( $response ));
        $identity->setIdentifier( $response->getUsername() );
        $identity->setType( $response->getResourceOwner()->getName() );
        $identity->setUser( $user );
        $identity->setName( $this->getRealName( $response ));
        $identity->setEmail( $this->getEmail( $response ));
        $this->om->persist( $identity );
        $this->om->flush();
        return $identity;
    }
protected function createIdentity ( User $ user , UserResponseInterface $ response ) { $ identity = new $ this -> userIdentityClass ; $ identity -> setAccessToken ( $ this -> getAccessToken ( $ response ) ) ; $ identity -> setIdentifier ( $ response -> getUsername ( ) ) ; $ identity -> setType ( $ response -> getResourceOwner ( ) -> getName ( ) ) ; $ identity -> setUser ( $ user ) ; $ identity -> setName ( $ this -> getRealName ( $ response ) ) ; $ identity -> setEmail ( $ this -> getEmail ( $ response ) ) ; $ this -> om -> persist ( $ identity ) ; $ this -> om -> flush ( ) ; return $ identity ; }
Creates new Identity

@param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
@param \Userfriendly\Bundle\SocialUserBundle\Model\User $user
@return \Userfriendly\Bundle\SocialUserBundle\Model\UserIdentity
Creates new Identity