/** * Create a hybrid OAuth request that contains the fields * that were requested in the OpenID request with the given * arguments. It's a factory function. * * $request: The OpenID authentication request from which to * extract a hybrid OAuth request. * * $cls: name of class to use when creating hybrid OAuth request object. * Used for testing. * * Returns the newly created hybrid OAuth request */ public static function fromOpenIDRequest($request) { $obj = new HybridOAuthRequest(); // Since we're going to mess with namespace URI mapping, don't // mutate the object that was passed in. $msg = $request->message; $obj->ns_uri = parent::getOAuthNS($msg); $args = $msg->getArgs($obj->ns_uri); if ($args == null || Auth_OpenID::isFailure($args)) { return null; } // parse extension arguments into the request object body $obj->parseExtensionArgs($args); return $obj; }
private function trust_render($info) { $oauth = HybridOAuthRequest::fromOpenIDRequest($info); $GLOBALS['render'] = array('info' => serialize($info), 'oauth' => serialize($oauth)); $this->template('openid/trust.php'); }