fixed and completed function to get assertion attributes
This commit is contained in:
parent
d731cd8885
commit
dc4f494aa4
|
@ -43,18 +43,12 @@ class LassoSPKitGenericSession {
|
|||
function setIdentityDump($dump) {
|
||||
$this->identity_dump = $dump;
|
||||
}
|
||||
function setAssertionAttributes($attributes) {
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
function getSessionDump() {
|
||||
return $this->session_dump;
|
||||
}
|
||||
function getIdentityDump() {
|
||||
return $this->identity_dump;
|
||||
}
|
||||
function getAssertionAttributes() {
|
||||
return $this->attributes;
|
||||
}
|
||||
function getNameIDs() {
|
||||
$identity_dump = $this->getIdentityDump();
|
||||
return LassoSPKitHelper::getNameIDsFromDump($identity_dump);
|
||||
|
@ -65,7 +59,7 @@ class LassoSPKitGenericSession {
|
|||
'identity'=> $this->getIdentityDump(),
|
||||
'session' => $this->getSessionDump(),
|
||||
'userid'=>$userid,
|
||||
'attributes' => $this->getAssertionAttributes());
|
||||
);
|
||||
}
|
||||
function explodeFederationBlob($blob) {
|
||||
$federation = @unserialize($blob);
|
||||
|
@ -81,7 +75,6 @@ class LassoSPKitGenericSession {
|
|||
if ($federation['userid'] && ! LassoSPKitUtilsSession::getUserID()) {
|
||||
LassoSPKitUtilsSession::setUserID($federation['userid']);
|
||||
}
|
||||
$this->setAssertionAttributes($federation['attributes']);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,4 +2,3 @@
|
|||
require_once('lassospkit_config.inc.php');
|
||||
$lasso_lib = LassoSPKitConfig::get('lasso_lib');
|
||||
require_once($lasso_lib);
|
||||
lasso_init();
|
||||
|
|
|
@ -129,3 +129,10 @@ function lassospkit_configure_url() {
|
|||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
function lassospkit_get_assertion_attributes() {
|
||||
$session = LassoSPKitUtilsSession::getSingleton();
|
||||
$attributes = $session->getAssertionAttributes();
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ require_once('lassospkit_config.inc.php');
|
|||
require_once('lassospkit_debug.inc.php');
|
||||
require_once('lassospkit_lib.inc.php');
|
||||
require_once('lassospkit_generic_session.inc.php');
|
||||
require_once('lassospkit_utils_session.inc.php');
|
||||
/**
|
||||
* TODO: initServer();
|
||||
*/
|
||||
|
@ -216,7 +217,8 @@ class LassoSPKitSAMLCommon {
|
|||
}
|
||||
if ($login->response->assertion) {
|
||||
$attributes = LassoSPKitHelper::assertionExtractAttributes($login->response->assertion[0]);
|
||||
$this->session->setAssertionAttributes($attributes);
|
||||
$utils_session = LassoSPKitUtilsSession::getSingleton();
|
||||
$utils_session->setAssertionAttributes($attributes);
|
||||
}
|
||||
$this->saveFederation($login);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,8 @@ class LassoSPKitUtilsSession {
|
|||
'federateParams'=>0,
|
||||
'sloParams'=>0,
|
||||
'defederationParams'=>0,
|
||||
'LogoutMethod'=>0);
|
||||
'LogoutMethod'=>0,
|
||||
'assertionAttributes'=>0);
|
||||
/** The keys that must not survive one communication (one set followed by one get). */
|
||||
static $keysToClearAfterGet = array(
|
||||
'LastError'=>0,
|
||||
|
@ -226,4 +227,12 @@ class LassoSPKitUtilsSession {
|
|||
$athis = self::getSingleton();
|
||||
$athis->set($profile ."Params", $Params);
|
||||
}
|
||||
static function setAssertionAttributes($attributes) {
|
||||
$athis = self::getSingleton();
|
||||
$athis->set('assertionAttributes', $attributes);
|
||||
}
|
||||
static function getAssertionAttributes() {
|
||||
$athis = self::getSingleton();
|
||||
return $athis->get('assertionAttributes');
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue