Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
8752b7cf
Commit
8752b7cf
authored
11 years ago
by
Jaime Perez
Committed by
Jaime Perez Crespo
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Delete old SP metadata interfaces.
parent
a8da478d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
www/saml2/sp/metadata.php
+0
-125
0 additions, 125 deletions
www/saml2/sp/metadata.php
www/shib13/sp/metadata.php
+0
-111
0 additions, 111 deletions
www/shib13/sp/metadata.php
with
0 additions
and
236 deletions
www/saml2/sp/metadata.php
deleted
100644 → 0
+
0
−
125
View file @
a8da478d
<?php
/**
* WARNING:
*
* THIS FILE IS DEPRECATED AND WILL BE REMOVED IN FUTURE VERSIONS
*
* @deprecated
*/
require_once
(
'../../_include.php'
);
/* Load simpleSAMLphp, configuration and metadata */
$config
=
SimpleSAML_Configuration
::
getInstance
();
$metadata
=
SimpleSAML_Metadata_MetaDataStorageHandler
::
getMetadataHandler
();
SimpleSAML_Logger
::
warning
(
'The file saml2/sp/metadata.php is deprecated and will be removed in future versions.'
);
if
(
!
$config
->
getValue
(
'enable.saml20-sp'
,
TRUE
))
throw
new
SimpleSAML_Error_Error
(
'NOACCESS'
);
/* Check if valid local session exists.. */
if
(
$config
->
getBoolean
(
'admin.protectmetadata'
,
false
))
{
SimpleSAML_Utilities
::
requireAdmin
();
}
try
{
$spentityid
=
isset
(
$_GET
[
'spentityid'
])
?
$_GET
[
'spentityid'
]
:
$metadata
->
getMetaDataCurrentEntityID
();
$spmeta
=
$metadata
->
getMetaDataConfig
(
$spentityid
,
'saml20-sp-hosted'
);
$metaArray
=
array
(
'metadata-set'
=>
'saml20-sp-remote'
,
'entityid'
=>
$spentityid
,
'AssertionConsumerService'
=>
$metadata
->
getGenerated
(
'AssertionConsumerService'
,
'saml20-sp-hosted'
),
);
$slob
=
$metadata
->
getGenerated
(
'SingleLogoutServiceBinding'
,
'saml20-sp-hosted'
);
$slol
=
$metadata
->
getGenerated
(
'SingleLogoutService'
,
'saml20-sp-hosted'
);
if
(
is_array
(
$slob
))
{
foreach
(
$slob
as
$binding
)
{
$metaArray
[
'SingleLogoutService'
][]
=
array
(
'Binding'
=>
$binding
,
'Location'
=>
$slol
,
);
}
}
else
{
$metaArray
[
'SingleLogoutService'
][]
=
array
(
'Binding'
=>
$slob
,
'Location'
=>
$slol
,
);
}
$metaArray
[
'NameIDFormat'
]
=
$spmeta
->
getString
(
'NameIDFormat'
,
'urn:oasis:names:tc:SAML:2.0:nameid-format:transient'
);
if
(
$spmeta
->
hasValue
(
'OrganizationName'
))
{
$metaArray
[
'OrganizationName'
]
=
$spmeta
->
getLocalizedString
(
'OrganizationName'
);
$metaArray
[
'OrganizationDisplayName'
]
=
$spmeta
->
getLocalizedString
(
'OrganizationDisplayName'
,
$metaArray
[
'OrganizationName'
]);
if
(
!
$spmeta
->
hasValue
(
'OrganizationURL'
))
{
throw
new
SimpleSAML_Error_Exception
(
'If OrganizationName is set, OrganizationURL must also be set.'
);
}
$metaArray
[
'OrganizationURL'
]
=
$spmeta
->
getLocalizedString
(
'OrganizationURL'
);
}
if
(
$spmeta
->
hasValue
(
'attributes'
))
{
$metaArray
[
'attributes'
]
=
$spmeta
->
getArray
(
'attributes'
);
}
if
(
$spmeta
->
hasValue
(
'attributes.NameFormat'
))
{
$metaArray
[
'attributes.NameFormat'
]
=
$spmeta
->
getString
(
'attributes.NameFormat'
);
}
if
(
$spmeta
->
hasValue
(
'name'
))
{
$metaArray
[
'name'
]
=
$spmeta
->
getLocalizedString
(
'name'
);
}
if
(
$spmeta
->
hasValue
(
'description'
))
{
$metaArray
[
'description'
]
=
$spmeta
->
getLocalizedString
(
'description'
);
}
$certInfo
=
SimpleSAML_Utilities
::
loadPublicKey
(
$spmeta
);
if
(
$certInfo
!==
NULL
&&
array_key_exists
(
'certData'
,
$certInfo
))
{
$metaArray
[
'certData'
]
=
$certInfo
[
'certData'
];
}
$metaflat
=
'$metadata['
.
var_export
(
$spentityid
,
TRUE
)
.
'] = '
.
var_export
(
$metaArray
,
TRUE
)
.
';'
;
$metaBuilder
=
new
SimpleSAML_Metadata_SAMLBuilder
(
$spentityid
);
$metaBuilder
->
addMetadataSP20
(
$metaArray
);
$metaBuilder
->
addOrganizationInfo
(
$metaArray
);
$metaBuilder
->
addContact
(
'technical'
,
array
(
'emailAddress'
=>
$config
->
getString
(
'technicalcontact_email'
,
NULL
),
'name'
=>
$config
->
getString
(
'technicalcontact_name'
,
NULL
),
));
$metaxml
=
$metaBuilder
->
getEntityDescriptorText
();
/* Sign the metadata if enabled. */
$metaxml
=
SimpleSAML_Metadata_Signer
::
sign
(
$metaxml
,
$spmeta
->
toArray
(),
'SAML 2 SP'
);
if
(
array_key_exists
(
'output'
,
$_REQUEST
)
&&
$_REQUEST
[
'output'
]
==
'xhtml'
)
{
$t
=
new
SimpleSAML_XHTML_Template
(
$config
,
'metadata.php'
,
'admin'
);
$t
->
data
[
'header'
]
=
'saml20-sp'
;
$t
->
data
[
'metadata'
]
=
htmlspecialchars
(
$metaxml
);
$t
->
data
[
'metadataflat'
]
=
htmlspecialchars
(
$metaflat
);
$t
->
data
[
'metaurl'
]
=
SimpleSAML_Utilities
::
selfURLNoQuery
();
$t
->
show
();
}
else
{
header
(
'Content-Type: application/xml'
);
echo
$metaxml
;
exit
(
0
);
}
}
catch
(
Exception
$exception
)
{
throw
new
SimpleSAML_Error_Error
(
'METADATA'
,
$exception
);
}
This diff is collapsed.
Click to expand it.
www/shib13/sp/metadata.php
deleted
100644 → 0
+
0
−
111
View file @
a8da478d
<?php
/**
* WARNING:
*
* THIS FILE IS DEPRECATED AND WILL BE REMOVED IN FUTURE VERSIONS
*
* @deprecated
*/
require_once
(
'../../_include.php'
);
/* Load simpleSAMLphp, configuration and metadata */
$config
=
SimpleSAML_Configuration
::
getInstance
();
$metadata
=
SimpleSAML_Metadata_MetaDataStorageHandler
::
getMetadataHandler
();
SimpleSAML_Logger
::
warning
(
'The file shib13/sp/metadata.php is deprecated and will be removed in future versions.'
);
if
(
!
$config
->
getBoolean
(
'enable.shib13-sp'
,
false
))
throw
new
SimpleSAML_Error_Error
(
'NOACCESS'
);
/* Check if valid local session exists.. */
if
(
$config
->
getBoolean
(
'admin.protectmetadata'
,
false
))
{
SimpleSAML_Utilities
::
requireAdmin
();
}
try
{
$spentityid
=
isset
(
$_GET
[
'spentityid'
])
?
$_GET
[
'spentityid'
]
:
$metadata
->
getMetaDataCurrentEntityID
(
'shib13-sp-hosted'
);
$spmeta
=
$metadata
->
getMetaDataConfig
(
$spentityid
,
'shib13-sp-hosted'
);
$metaArray
=
array
(
'metadata-set'
=>
'shib13-sp-remote'
,
'entityid'
=>
$spentityid
,
'AssertionConsumerService'
=>
$metadata
->
getGenerated
(
'AssertionConsumerService'
,
'shib13-sp-hosted'
),
);
$certInfo
=
SimpleSAML_Utilities
::
loadPublicKey
(
$spmeta
);
if
(
$certInfo
!==
NULL
&&
array_key_exists
(
'certData'
,
$certInfo
))
{
$metaArray
[
'certData'
]
=
$certInfo
[
'certData'
];
}
$metaArray
[
'NameIDFormat'
]
=
$spmeta
->
getString
(
'NameIDFormat'
,
'urn:mace:shibboleth:1.0:nameIdentifier'
);
if
(
$spmeta
->
hasValue
(
'OrganizationName'
))
{
$metaArray
[
'OrganizationName'
]
=
$spmeta
->
getLocalizedString
(
'OrganizationName'
);
$metaArray
[
'OrganizationDisplayName'
]
=
$spmeta
->
getLocalizedString
(
'OrganizationDisplayName'
,
$metaArray
[
'OrganizationName'
]);
if
(
!
$spmeta
->
hasValue
(
'OrganizationURL'
))
{
throw
new
SimpleSAML_Error_Exception
(
'If OrganizationName is set, OrganizationURL must also be set.'
);
}
$metaArray
[
'OrganizationURL'
]
=
$spmeta
->
getLocalizedString
(
'OrganizationURL'
);
}
if
(
$spmeta
->
hasValue
(
'attributes'
))
{
$metaArray
[
'attributes'
]
=
$spmeta
->
getArray
(
'attributes'
);
}
if
(
$spmeta
->
hasValue
(
'attributes.NameFormat'
))
{
$metaArray
[
'attributes.NameFormat'
]
=
$spmeta
->
getString
(
'attributes.NameFormat'
);
}
if
(
$spmeta
->
hasValue
(
'name'
))
{
$metaArray
[
'name'
]
=
$spmeta
->
getLocalizedString
(
'name'
);
}
if
(
$spmeta
->
hasValue
(
'description'
))
{
$metaArray
[
'description'
]
=
$spmeta
->
getLocalizedString
(
'description'
);
}
$metaflat
=
'$metadata['
.
var_export
(
$spentityid
,
TRUE
)
.
'] = '
.
var_export
(
$metaArray
,
TRUE
)
.
';'
;
if
(
$spmeta
->
hasValue
(
'certificate'
))
{
$metaArray
[
'certificate'
]
=
$spmeta
->
getString
(
'certificate'
);
}
$metaBuilder
=
new
SimpleSAML_Metadata_SAMLBuilder
(
$spentityid
);
$metaBuilder
->
addMetadataSP11
(
$metaArray
);
$metaBuilder
->
addOrganizationInfo
(
$metaArray
);
$metaBuilder
->
addContact
(
'technical'
,
array
(
'emailAddress'
=>
$config
->
getString
(
'technicalcontact_email'
,
NULL
),
'name'
=>
$config
->
getString
(
'technicalcontact_name'
,
NULL
),
));
$metaxml
=
$metaBuilder
->
getEntityDescriptorText
();
/* Sign the metadata if enabled. */
$metaxml
=
SimpleSAML_Metadata_Signer
::
sign
(
$metaxml
,
$spmeta
->
toArray
(),
'Shib 1.3 SP'
);
if
(
array_key_exists
(
'output'
,
$_GET
)
&&
$_GET
[
'output'
]
==
'xhtml'
)
{
$t
=
new
SimpleSAML_XHTML_Template
(
$config
,
'metadata.php'
,
'admin'
);
$t
->
data
[
'header'
]
=
'shib13-sp'
;
$t
->
data
[
'metadata'
]
=
htmlspecialchars
(
$metaxml
);
$t
->
data
[
'metadataflat'
]
=
htmlspecialchars
(
$metaflat
);
$t
->
data
[
'metaurl'
]
=
SimpleSAML_Utilities
::
addURLparameter
(
SimpleSAML_Utilities
::
selfURLNoQuery
(),
array
(
'output'
=>
'xml'
));
$t
->
show
();
}
else
{
header
(
'Content-Type: application/xml'
);
echo
$metaxml
;
exit
(
0
);
}
}
catch
(
Exception
$exception
)
{
throw
new
SimpleSAML_Error_Error
(
'METADATA'
,
$exception
);
}
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment