Example #1
0
 private function makeCheckIdRequest(OpenIdCredentials $credentials, HttpUrl $returnTo, $trustRoot = null, $association = null)
 {
     Assert::isTrue($returnTo->isValid());
     $view = RedirectView::create($credentials->getServer()->toString());
     $model = Model::create()->set('openid.ns', self::NAMESPACE_2_0)->set('openid.identity', $credentials->getRealId()->toString())->set('openid.return_to', $returnTo->toString())->set('openid.claimed_id', $credentials->getRealId()->toString());
     foreach ($this->extensions as $extension) {
         $extension->addParamsToModel($model);
     }
     if ($association) {
         Assert::isTrue($association instanceof OpenIdConsumerAssociation && $association->getServer()->toString() == $credentials->getServer()->toString());
         $model->set('openid.assoc_handle', $association->getHandle());
     }
     if ($trustRoot) {
         Assert::isTrue($trustRoot instanceof HttpUrl && $trustRoot->isValid());
         $model->set('openid.trust_root', $trustRoot->toString())->set('openid.realm', $trustRoot->toString());
     }
     return ModelAndView::create()->setModel($model)->setView($view);
 }