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;
    }