Example #1
0
 /**
  * {@inheritdoc}
  */
 public function authenticateFinish()
 {
     parent::authenticateFinish();
     $userProfile = $this->storage->get($this->providerId . '.user');
     $userProfile->identifier = $userProfile->email;
     $userProfile->emailVerified = $userProfile->email;
     // re store the user profile
     $this->storage->set($this->providerId . '.user', $userProfile);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function loginFinish()
 {
     parent::loginFinish();
     $userProfile = $this->storage->get($this->providerId . '.user');
     $userProfile->identifier = str_ireplace('http://steamcommunity.com/openid/id/', '', $userProfile->identifier);
     if (!$userProfile->identifier) {
         throw new UnexpectedValueException('Provider API returned an unexpected response.');
     }
     $result = array();
     // if api key is provided, we attempt to use steam web api
     if ($this->config->filter('keys')->exists('secret')) {
         $result = $this->getUserProfileWebAPI($this->config->filter('keys')->get('secret'), $userProfile->identifier);
     } else {
         $result = $this->getUserProfileLegacyAPI($userProfile->identifier);
     }
     // fetch user profile
     foreach ($result as $k => $v) {
         $userProfile->{$k} = $v ?: $userProfile->{$k};
     }
     // store user profile
     $this->storage->set($this->providerId . '.user', $userProfile);
 }