Exemple #1
0
 function test_noReturnTo()
 {
     // will be a ProtocolError raised by Decode or CheckIDRequest.answer
     $args = array('openid.mode' => 'zebradance', 'openid.identity' => 'http://wagu.unittest/');
     $e = new Auth_OpenID_ServerError($args, "waffles");
     $this->assertFalse($e->hasReturnTo());
     $expected = "error:waffles\nmode:error\n";
     $this->assertEquals($e->encodeToKVForm(), $expected);
 }
Exemple #2
0
	function Auth_OpenID_UntrustedReturnURL($message, $return_to,
	$trust_root)
	{
		parent::Auth_OpenID_ServerError($message, "Untrusted return_to URL");
		$this->return_to = $return_to;
		$this->trust_root = $trust_root;
	}
Exemple #3
0
 function Auth_OpenID_UntrustedReturnURL($return_to, $trust_root)
 {
     global $_Auth_OpenID_OpenID_Prefix;
     $query = array($_Auth_OpenID_OpenID_Prefix . 'return_to' => $return_to, $_Auth_OpenID_OpenID_Prefix . 'trust_root' => $trust_root);
     parent::Auth_OpenID_ServerError($query);
 }
 function test_protoErrorFields()
 {
     $contact = '*****@*****.**';
     $reference = 'Trac ticket number MAX_INT';
     $error = 'poltergeist';
     $openid1_args = array('openid.identitiy' => 'invalid', 'openid.mode' => 'checkid_setup');
     $openid2_args = $openid1_args;
     $openid2_args = array_merge($openid2_args, array('openid.ns' => Auth_OpenID_OPENID2_NS));
     // Check presence of optional fields in both protocol versions
     $openid1_msg = Auth_OpenID_Message::fromPostArgs($openid1_args);
     $p = new Auth_OpenID_ServerError($openid1_msg, $error, $reference, $contact);
     $reply = $p->toMessage();
     $this->assertEquals($reply->getArg(Auth_OpenID_OPENID_NS, 'reference'), $reference);
     $this->assertEquals($reply->getArg(Auth_OpenID_OPENID_NS, 'contact'), $contact);
     $openid2_msg = Auth_OpenID_Message::fromPostArgs($openid2_args);
     $p = new Auth_OpenID_ServerError($openid2_msg, $error, $reference, $contact);
     $reply = $p->toMessage();
     $this->assertEquals($reply->getArg(Auth_OpenID_OPENID_NS, 'reference'), $reference);
     $this->assertEquals($reply->getArg(Auth_OpenID_OPENID_NS, 'contact'), $contact);
 }
Exemple #5
0
 function __construct($message, $return_to, $trust_root)
 {
     parent::__construct($message, "Untrusted return_to URL");
     $this->return_to = $return_to;
     $this->trust_root = $trust_root;
 }
Exemple #6
0
 public function __construct($message, $return_to, $trust_root)
 {
     parent::Auth_OpenID_ServerError($message, "Untrusted return_to URL");
     $this->return_to = $return_to;
     $this->trust_root = $trust_root;
 }