Commit 0a21f229 authored by haemmer's avatar haemmer

Added code to parse MDUI:Keywords from SAML2 metadata

parent fa6788e0
......@@ -326,6 +326,12 @@ function processIDPRoleDescriptor($IDPRoleDescriptorNode){
$protocols = $IDPRoleDescriptorNode->getAttribute('protocolSupportEnumeration');
$IDP['Protocols'] = $protocols;
// Get keywords
$MDUIKeywords = getMDUIKeywords($IDPRoleDescriptorNode);
foreach ($MDUIKeywords as $lang => $keywords){
$IDP[$lang]['Keywords'] = $keywords;
}
return $IDP;
}
......@@ -386,6 +392,12 @@ function processSPRoleDescriptor($SPRoleDescriptorNode){
$protocols = $SPRoleDescriptorNode->getAttribute('protocolSupportEnumeration');
$SP['Protocols'] = $protocols;
// Get keywords
$MDUIKeywords = getMDUIKeywords($SPRoleDescriptorNode);
foreach ($MDUIKeywords as $lang => $keywords){
$SP[$lang]['Keywords'] = $keywords;
}
return $SP;
}
......@@ -479,6 +491,20 @@ function getMDUIDisplayNames($RoleDescriptorNode){
return $Entity;
}
/******************************************************************************/
// Get MD Keywords from RoleDescriptor
function getMDUIKeywords($RoleDescriptorNode){
$Entity = Array();
$MDUIKeywords = $RoleDescriptorNode->getElementsByTagNameNS('urn:oasis:names:tc:SAML:metadata:ui', 'Keywords');
foreach( $MDUIKeywords as $MDUIKeywordEntry ){
$lang = $MDUIKeywordEntry->getAttributeNodeNS('http://www.w3.org/XML/1998/namespace', 'lang')->nodeValue;
$Entity[$lang] = $MDUIKeywordEntry->nodeValue;
}
return $Entity;
}
/******************************************************************************/
// Get Organization Names from RoleDescriptor
function getOrganizationNames($RoleDescriptorNode){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment