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
e8742a2b
Commit
e8742a2b
authored
9 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Reformat the files remaining in www/saml2/idp/.
parent
68e27e18
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
www/saml2/idp/ArtifactResolutionService.php
+11
-11
11 additions, 11 deletions
www/saml2/idp/ArtifactResolutionService.php
www/saml2/idp/SingleLogoutService.php
+7
-5
7 additions, 5 deletions
www/saml2/idp/SingleLogoutService.php
www/saml2/idp/initSLO.php
+4
-4
4 additions, 4 deletions
www/saml2/idp/initSLO.php
with
22 additions
and
20 deletions
www/saml2/idp/ArtifactResolutionService.php
+
11
−
11
View file @
e8742a2b
...
...
@@ -11,21 +11,21 @@
require_once
(
'../../_include.php'
);
$config
=
SimpleSAML_Configuration
::
getInstance
();
if
(
!
$config
->
getBoolean
(
'enable.saml20-idp'
,
FALSE
))
{
throw
new
SimpleSAML_Error_Error
(
'NOACCESS'
);
if
(
!
$config
->
getBoolean
(
'enable.saml20-idp'
,
false
))
{
throw
new
SimpleSAML_Error_Error
(
'NOACCESS'
);
}
$metadata
=
SimpleSAML_Metadata_MetaDataStorageHandler
::
getMetadataHandler
();
$idpEntityId
=
$metadata
->
getMetaDataCurrentEntityID
(
'saml20-idp-hosted'
);
$idpMetadata
=
$metadata
->
getMetaDataConfig
(
$idpEntityId
,
'saml20-idp-hosted'
);
if
(
!
$idpMetadata
->
getBoolean
(
'saml20.sendartifact'
,
FALSE
))
{
throw
new
SimpleSAML_Error_Error
(
'NOACCESS'
);
if
(
!
$idpMetadata
->
getBoolean
(
'saml20.sendartifact'
,
false
))
{
throw
new
SimpleSAML_Error_Error
(
'NOACCESS'
);
}
$store
=
SimpleSAML_Store
::
getInstance
();
if
(
$store
===
FALSE
)
{
throw
new
Exception
(
'Unable to send artifact without a datastore configured.'
);
if
(
$store
===
false
)
{
throw
new
Exception
(
'Unable to send artifact without a datastore configured.'
);
}
$binding
=
new
SAML2_SOAP
();
...
...
@@ -42,7 +42,7 @@ try {
}
}
if
(
!
(
$request
instanceof
SAML2_ArtifactResolve
))
{
throw
new
Exception
(
'Message received on ArtifactResolutionService wasn\'t a ArtifactResolve request.'
);
throw
new
Exception
(
'Message received on ArtifactResolutionService wasn\'t a ArtifactResolve request.'
);
}
$issuer
=
$request
->
getIssuer
();
...
...
@@ -53,11 +53,11 @@ $artifact = $request->getArtifact();
$responseData
=
$store
->
get
(
'artifact'
,
$artifact
);
$store
->
delete
(
'artifact'
,
$artifact
);
if
(
$responseData
!==
NULL
)
{
$document
=
SAML2_DOMDocumentFactory
::
fromString
(
$responseData
);
$responseXML
=
$document
->
firstChild
;
if
(
$responseData
!==
null
)
{
$document
=
SAML2_DOMDocumentFactory
::
fromString
(
$responseData
);
$responseXML
=
$document
->
firstChild
;
}
else
{
$responseXML
=
NULL
;
$responseXML
=
null
;
}
$artifactResponse
=
new
SAML2_ArtifactResponse
();
...
...
This diff is collapsed.
Click to expand it.
www/saml2/idp/SingleLogoutService.php
+
7
−
5
View file @
e8742a2b
<?php
/**
* This SAML 2.0 endpoint can receive incoming LogoutRequests. It will also send LogoutResponses,
* This SAML 2.0 endpoint can receive incoming LogoutRequests. It will also send LogoutResponses,
* and LogoutRequests and also receive LogoutResponses. It is implemeting SLO at the SAML 2.0 IdP.
*
* @author Andreas Åkre Solberg, UNINETT AS. <andreas.solberg@uninett.no>
...
...
@@ -14,16 +14,18 @@ SimpleSAML_Logger::info('SAML2.0 - IdP.SingleLogoutService: Accessing SAML 2.0 I
$metadata
=
SimpleSAML_Metadata_MetaDataStorageHandler
::
getMetadataHandler
();
$idpEntityId
=
$metadata
->
getMetaDataCurrentEntityID
(
'saml20-idp-hosted'
);
$idp
=
SimpleSAML_IdP
::
getById
(
'saml2:'
.
$idpEntityId
);
$idp
=
SimpleSAML_IdP
::
getById
(
'saml2:'
.
$idpEntityId
);
if
(
isset
(
$_REQUEST
[
'ReturnTo'
]))
{
$idp
->
doLogoutRedirect
(
\SimpleSAML\Utils\HTTP
::
checkURLAllowed
((
string
)
$_REQUEST
[
'ReturnTo'
]));
$idp
->
doLogoutRedirect
(
\SimpleSAML\Utils\HTTP
::
checkURLAllowed
((
string
)
$_REQUEST
[
'ReturnTo'
]));
}
else
{
try
{
sspmod_saml_IdP_SAML2
::
receiveLogoutMessage
(
$idp
);
}
catch
(
Exception
$e
)
{
// TODO: look for a specific exception
// This is dirty. Instead of checking the message of the exception, SAML2_Binding::getCurrentBinding() should throw
// an specific exception when the binding is unknown, and we should capture that here
/*
* This is dirty. Instead of checking the message of the exception, SAML2_Binding::getCurrentBinding() should
* throw an specific exception when the binding is unknown, and we should capture that here
*/
if
(
$e
->
getMessage
()
===
'Unable to find the current binding.'
)
{
throw
new
SimpleSAML_Error_Error
(
'SLOSERVICEPARAMS'
,
$e
,
400
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
www/saml2/idp/initSLO.php
+
4
−
4
View file @
e8742a2b
...
...
@@ -3,13 +3,13 @@ require_once('../../_include.php');
$metadata
=
SimpleSAML_Metadata_MetaDataStorageHandler
::
getMetadataHandler
();
$idpEntityId
=
$metadata
->
getMetaDataCurrentEntityID
(
'saml20-idp-hosted'
);
$idp
=
SimpleSAML_IdP
::
getById
(
'saml2:'
.
$idpEntityId
);
$idp
=
SimpleSAML_IdP
::
getById
(
'saml2:'
.
$idpEntityId
);
SimpleSAML_Logger
::
info
(
'SAML2.0 - IdP.initSLO: Accessing SAML 2.0 IdP endpoint init Single Logout'
);
if
(
!
isset
(
$_GET
[
'RelayState'
]))
{
throw
new
SimpleSAML_Error_Error
(
'NORELAYSTATE'
);
throw
new
SimpleSAML_Error_Error
(
'NORELAYSTATE'
);
}
$idp
->
doLogoutRedirect
(
\SimpleSAML\Utils\HTTP
::
checkURLAllowed
((
string
)
$_GET
[
'RelayState'
]));
assert
(
'FALSE'
);
\ No newline at end of file
$idp
->
doLogoutRedirect
(
\SimpleSAML\Utils\HTTP
::
checkURLAllowed
((
string
)
$_GET
[
'RelayState'
]));
assert
(
'FALSE'
);
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