ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_AssociateRequest Class Reference
+ Inheritance diagram for Auth_OpenID_AssociateRequest:
+ Collaboration diagram for Auth_OpenID_AssociateRequest:

Public Member Functions

 Auth_OpenID_AssociateRequest ($session, $assoc_type)
 answer ($assoc)
 answerUnsupported ($text_message, $preferred_association_type=null, $preferred_session_type=null)

Static Public Member Functions

static getSessionClasses ()
static fromMessage ($message, $server=null)

Data Fields

 $mode = "associate"
- Data Fields inherited from Auth_OpenID_Request
 $mode = null

Detailed Description

Definition at line 582 of file Server.php.

Member Function Documentation

Auth_OpenID_AssociateRequest::answer (   $assoc)

Definition at line 652 of file Server.php.

References Auth_OpenID_OPENID_NS.

{
$response = new Auth_OpenID_ServerResponse($this);
$response->fields->updateArgs(Auth_OpenID_OPENID_NS,
array(
'expires_in' => sprintf('%d', $assoc->getExpiresIn()),
'assoc_type' => $this->assoc_type,
'assoc_handle' => $assoc->handle));
$response->fields->updateArgs(Auth_OpenID_OPENID_NS,
$this->session->answer($assoc->secret));
if (! ($this->session->session_type == 'no-encryption'
&& $this->message->isOpenID1())) {
$response->fields->setArg(Auth_OpenID_OPENID_NS,
'session_type',
$this->session->session_type);
}
return $response;
}
Auth_OpenID_AssociateRequest::answerUnsupported (   $text_message,
  $preferred_association_type = null,
  $preferred_session_type = null 
)

Definition at line 674 of file Server.php.

References AUTH_OPENID_HTTP_ERROR, and Auth_OpenID_OPENID_NS.

{
if ($this->message->isOpenID1()) {
return new Auth_OpenID_ServerError($this->message);
}
$response = new Auth_OpenID_ServerResponse($this);
$response->fields->setArg(Auth_OpenID_OPENID_NS,
'error_code', 'unsupported-type');
$response->fields->setArg(Auth_OpenID_OPENID_NS,
'error', $text_message);
if ($preferred_association_type) {
$response->fields->setArg(Auth_OpenID_OPENID_NS,
'assoc_type',
$preferred_association_type);
}
if ($preferred_session_type) {
$response->fields->setArg(Auth_OpenID_OPENID_NS,
'session_type',
$preferred_session_type);
}
$response->code = AUTH_OPENID_HTTP_ERROR;
return $response;
}
Auth_OpenID_AssociateRequest::Auth_OpenID_AssociateRequest (   $session,
  $assoc_type 
)

Definition at line 593 of file Server.php.

References Auth_OpenID_OPENID2_NS.

Referenced by fromMessage().

{
$this->session = $session;
$this->namespace = Auth_OpenID_OPENID2_NS;
$this->assoc_type = $assoc_type;
}

+ Here is the caller graph for this function:

static Auth_OpenID_AssociateRequest::fromMessage (   $message,
  $server = null 
)
static

Definition at line 600 of file Server.php.

References Auth_OpenID\arrayGet(), Auth_OpenID_AssociateRequest(), Auth_OpenID_OPENID_NS, and getSessionClasses().

{
if ($message->isOpenID1()) {
$session_type = $message->getArg(Auth_OpenID_OPENID_NS,
'session_type');
if ($session_type == 'no-encryption') {
// oidutil.log('Received OpenID 1 request with a no-encryption '
// 'assocaition session type. Continuing anyway.')
} else if (!$session_type) {
$session_type = 'no-encryption';
}
} else {
$session_type = $message->getArg(Auth_OpenID_OPENID_NS,
'session_type');
if ($session_type === null) {
return new Auth_OpenID_ServerError($message,
"session_type missing from request");
}
}
$session_class = Auth_OpenID::arrayGet(
$session_type);
if ($session_class === null) {
return new Auth_OpenID_ServerError($message,
"Unknown session type " .
$session_type);
}
$session = call_user_func(array($session_class, 'fromMessage'),
$message);
if (is_a($session, 'Auth_OpenID_ServerError')) {
return $session;
}
$assoc_type = $message->getArg(Auth_OpenID_OPENID_NS,
'assoc_type', 'HMAC-SHA1');
if (!in_array($assoc_type, $session->allowed_assoc_types)) {
$fmt = "Session type %s does not support association type %s";
return new Auth_OpenID_ServerError($message,
sprintf($fmt, $session_type, $assoc_type));
}
$obj = new Auth_OpenID_AssociateRequest($session, $assoc_type);
$obj->message = $message;
$obj->namespace = $message->getOpenIDNamespace();
return $obj;
}

+ Here is the call graph for this function:

static Auth_OpenID_AssociateRequest::getSessionClasses ( )
static

Definition at line 585 of file Server.php.

Referenced by fromMessage().

{
return array(
'no-encryption' => 'Auth_OpenID_PlainTextServerSession',
'DH-SHA1' => 'Auth_OpenID_DiffieHellmanSHA1ServerSession',
'DH-SHA256' => 'Auth_OpenID_DiffieHellmanSHA256ServerSession');
}

+ Here is the caller graph for this function:

Field Documentation

Auth_OpenID_AssociateRequest::$mode = "associate"

Definition at line 583 of file Server.php.


The documentation for this class was generated from the following file: