Closed AndrewECooper closed 8 years ago
@AndrewECooper sorry for this delated replay.
If you paste the XML at https://www.samltool.com/validate_xml.php and select SAML Response xsd you will see that the validation fails.
I wonder why all the strings on the XML are lowercase. The standard expects samlp:Response and no samlp:response
who is generating this SAMLResponse? simpleSAMLphp generates SAMLResponse correctly (notice the nameTag is not lowercase) ,
Review your environment, I think that you/some intermediate service made some change on the original XML.
Thanks pitbulk. I will look into that and get back with you.
@AndrewECooper have you solved that issue?
No. I quit trying to use SimpleSAML and just got a free account with OneLogin to test with. I used the SAML Response Validation tool that you suggested. My SAML Response is...
<samlp:Response xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="Ra5193b7a927a9c3af45f767e774fd272d9709429" Version="2.0" IssueInstant="2016-05-04T09:37:20Z" Destination="https://stage.originsystems.co.za/?acs" InResponseTo="ONELOGIN_3c231e1a984002ae60f24e6ebaf9134b8be9704e">
<saml:Issuer>https://app.onelogin.com/saml/metadata/515372</saml:Issuer>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2.0" ID="pfxc5d2b173-a4de-37d5-46de-5089c8332dca" IssueInstant="2016-05-04T09:37:20Z">
<saml:Issuer>https://app.onelogin.com/saml/metadata/515372</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#pfxc5d2b173-a4de-37d5-46de-5089c8332dca">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>zXfzBCtyN0zUwlaM2pQI5JZ0yag=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>hGjIxyDY+hDGGEh+xEERL6tXRKVgjtgq4AvCO4rH0XA/4n7pzTzYAuG+ZgcT3Mc+AiESrzlIO4GWIcI5WtyE8Evfp37ZZk3lQgmcr64EAd3Bt+C5psEctw9NBa7PRSFRpqgwIPyAM+oKrZDSqIjm/RjwLI4J9M00mny2DIyIkHe7APLa+Id8Qa1i/czhaaQ750Bc4ZYnC1izkNkroUw2M8z95LaKdQYM2G1dRSuAsfIxhmGLxu0qV7YToY72Vc4HASDh1PiMDXwayHbyv5GifjCU6ELaYaRJ5AG4TrMvRKVDews8dJ/uI6P0pBm/sxCEXQREOWMqR2t1nQb0+QeARQ==</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>MIIEKTCCAxGgAwIBAgIUA75ogPoRMFx7QhUV4OgYeYePZRswDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMxFzAVBgNVBAoMDk9yaWdpbiBTeXN0ZW1zMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgNzc2MDAwHhcNMTYwMjA0MTQzODUzWhcNMjEwMjA1MTQzODUzWjBeMQswCQYDVQQGEwJVUzEXMBUGA1UECgwOT3JpZ2luIFN5c3RlbXMxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwWT25lTG9naW4gQWNjb3VudCA3NzYwMDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5Vyy3c/hWkAzDDax51CMURj5HD8LW4fn4grV0vZZrO/V0hpbxY05PV62auZwqydbsAyyosv8eHgbn6kMb9yN4cPaOmrqP3d0Ad7V1LaCStaf/Lp0nGHUBZVBLa4fis/0im+wMVOywSGMM3po0+r7IPpykEE01R6m7Wgj/Uu2Ck/llh5y0zRDAP1NYXnYsZyTuvvzh3yszvt8xqaEJqq6FTHMHPdiC3+D2gcGbV6hkfLcUq41lQHIZ2rm2jM9CNkqlmGGpX6tb6E46+iP59yuHG3TF8bhr8uyRA18QJRidkq4SGw/D9QDeu/UagavFyfB6msqJG1CS0VK+zMnIPDgcCAwEAAaOB3jCB2zAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBSFeCtQ2Bo4Xm06dz7tJ13TiuKDyzCBmwYDVR0jBIGTMIGQgBSFeCtQ2Bo4Xm06dz7tJ13TiuKDy6FipGAwXjELMAkGA1UEBhMCVVMxFzAVBgNVBAoMDk9yaWdpbiBTeXN0ZW1zMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgNzc2MDCCFAO+aID6ETBce0IVFeDoGHmHj2UbMA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0BAQUFAAOCAQEARnD5A8DN5r1Gbr2iwaF1c/Ccd9eXfI84TULq4k0QluzwUGnUiTZXJBqHcy2GEXUt/hfoAiFk9hx+x1EvzCriTM7P5yOnQLDoz1Vb6moGGMVyzL1/2E18zllZ+hZsSY2WsoR8jB1iyTSzot/febggQuVN0f34sMnCVdeAXKqnVKxvkm+PmcWkgKAqpo5MT2LT1EdTI/zxI+DAi99hsYKmodAoWgPewDNtRsremQIadnqzaPNMQbcgd89N9Ext6zIcArAViz+XpoAR80HCy8PVo3Ss+bzZJainymqGK65ulYgeHiN0WYTRORE82RXGwvs2vO/r926pZspLt+0vHzlcLQ==</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">andrew.cooper@originsystems.co.za</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData NotOnOrAfter="2016-05-04T09:40:20Z" Recipient="https://stage.originsystems.co.za/?acs" InResponseTo="ONELOGIN_3c231e1a984002ae60f24e6ebaf9134b8be9704e"/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2016-05-04T09:34:20Z" NotOnOrAfter="2016-05-04T09:40:20Z">
<saml:AudienceRestriction>
<saml:Audience>https://stage.originsystems.co.za/sso-metadata.php</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="2016-05-04T09:37:19Z" SessionNotOnOrAfter="2016-05-05T09:37:20Z" SessionIndex="_d2a86a00-f3fc-0133-4fea-02b8ddb34353">
<saml:AuthnContext>
<saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement>
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="User.LastName">
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Cooper</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="PersonImmutableID">
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string"/>
</saml:Attribute>
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="User.email">
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">andrew.cooper@originsystems.co.za</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="Title">
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Grand High Pumba</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="memberOf">
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string"/>
</saml:Attribute>
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="User.FirstName">
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Andrew</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
</samlp:Response>
My IdP entityId = https://app.onelogin.com/saml/metadata/515372 SP entityId = https://stage.originsystems.co.za/metadata.php ACS Endpoint = https://stage.originsystems.co.za/?acs Target URL = https://stage.originsystems.co.za/?acs
X.509 Cert = MIIEKTCCAxGgAwIBAgIUA75ogPoRMFx7QhUV4OgYeYePZRswDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMxFzAVBgNVBAoMDk9yaWdpbiBTeXN0ZW1zMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgNzc2MDAwHhcNMTYwMjA0MTQzODUzWhcNMjEwMjA1MTQzODUzWjBeMQswCQYDVQQGEwJVUzEXMBUGA1UECgwOT3JpZ2luIFN5c3RlbXMxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwWT25lTG9naW4gQWNjb3VudCA3NzYwMDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5Vyy3c/hWkAzDDax51CMURj5HD8LW4fn4grV0vZZrO/V0hpbxY05PV62auZwqydbsAyyosv8eHgbn6kMb9yN4cPaOmrqP3d0Ad7V1LaCStaf/Lp0nGHUBZVBLa4fis/0im+wMVOywSGMM3po0+r7IPpykEE01R6m7Wgj/Uu2Ck/llh5y0zRDAP1NYXnYsZyTuvvzh3yszvt8xqaEJqq6FTHMHPdiC3+D2gcGbV6hkfLcUq41lQHIZ2rm2jM9CNkqlmGGpX6tb6E46+iP59yuHG3TF8bhr8uyRA18QJRidkq4SGw/D9QDeu/UagavFyfB6msqJG1CS0VK+zMnIPDgcCAwEAAaOB3jCB2zAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBSFeCtQ2Bo4Xm06dz7tJ13TiuKDyzCBmwYDVR0jBIGTMIGQgBSFeCtQ2Bo4Xm06dz7tJ13TiuKDy6FipGAwXjELMAkGA1UEBhMCVVMxFzAVBgNVBAoMDk9yaWdpbiBTeXN0ZW1zMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgNzc2MDCCFAO+aID6ETBce0IVFeDoGHmHj2UbMA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0BAQUFAAOCAQEARnD5A8DN5r1Gbr2iwaF1c/Ccd9eXfI84TULq4k0QluzwUGnUiTZXJBqHcy2GEXUt/hfoAiFk9hx+x1EvzCriTM7P5yOnQLDoz1Vb6moGGMVyzL1/2E18zllZ+hZsSY2WsoR8jB1iyTSzot/febggQuVN0f34sMnCVdeAXKqnVKxvkm+PmcWkgKAqpo5MT2LT1EdTI/zxI+DAi99hsYKmodAoWgPewDNtRsremQIadnqzaPNMQbcgd89N9Ext6zIcArAViz+XpoAR80HCy8PVo3Ss+bzZJainymqGK65ulYgeHiN0WYTRORE82RXGwvs2vO/r926pZspLt+0vHzlcLQ==
However I get the following error.
https://stage.originsystems.co.za/metadata.php is not a valid audience for this Response
I don't know why the audience is invalid. It doesn't give any more detail than that. On the actual site the error is is giving is
Signature validation failed. SAML Response rejected
The metadata that I'm using is
$settingsArray = array (
'sp' => array (
'entityId' => 'https://stage.originsystems.co.za/metadata.php',
'assertionConsumerService' => array (
'url' => 'https://stage.originsystems.co.za/?acs',
),
'singleLogoutService' => array (
'url' => 'https://stage.originsystems.co.za/?slo',
),
'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress',
// 'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress',
),
'idp' => array(
"entityId" => "https://app.onelogin.com/saml/metadata/515372",
"singleSignOnService" => array (
"url" => "https://originsystems.onelogin.com/trust/saml2/http-post/sso/515372",
"binding" => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
),
"singleLogoutService" => array(
"url" => "https://originsystems.onelogin.com/trust/saml2/http-redirect/slo/515372",
"binding" => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
),
"x509cert" => "MIIEKTCCAxGgAwIBAgIUA75ogPoRMFx7QhUV4OgYeYePZRswDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMxFzAVBgNVBAoMDk9yaWdpbiBTeXN0ZW1zMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgNzc2MDAwHhcNMTYwMjA0MTQzODUzWhcNMjEwMjA1MTQzODUzWjBeMQswCQYDVQQGEwJVUzEXMBUGA1UECgwOT3JpZ2luIFN5c3RlbXMxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwWT25lTG9naW4gQWNjb3VudCA3NzYwMDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5Vyy3c/hWkAzDDax51CMURj5HD8LW4fn4grV0vZZrO/V0hpbxY05PV62auZwqydbsAyyosv8eHgbn6kMb9yN4cPaOmrqP3d0Ad7V1LaCStaf/Lp0nGHUBZVBLa4fis/0im+wMVOywSGMM3po0+r7IPpykEE01R6m7Wgj/Uu2Ck/llh5y0zRDAP1NYXnYsZyTuvvzh3yszvt8xqaEJqq6FTHMHPdiC3+D2gcGbV6hkfLcUq41lQHIZ2rm2jM9CNkqlmGGpX6tb6E46+iP59yuHG3TF8bhr8uyRA18QJRidkq4SGw/D9QDeu/UagavFyfB6msqJG1CS0VK+zMnIPDgcCAwEAAaOB3jCB2zAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBSFeCtQ2Bo4Xm06dz7tJ13TiuKDyzCBmwYDVR0jBIGTMIGQgBSFeCtQ2Bo4Xm06dz7tJ13TiuKDy6FipGAwXjELMAkGA1UEBhMCVVMxFzAVBgNVBAoMDk9yaWdpbiBTeXN0ZW1zMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgNzc2MDCCFAO+aID6ETBce0IVFeDoGHmHj2UbMA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0BAQUFAAOCAQEARnD5A8DN5r1Gbr2iwaF1c/Ccd9eXfI84TULq4k0QluzwUGnUiTZXJBqHcy2GEXUt/hfoAiFk9hx+x1EvzCriTM7P5yOnQLDoz1Vb6moGGMVyzL1/2E18zllZ+hZsSY2WsoR8jB1iyTSzot/febggQuVN0f34sMnCVdeAXKqnVKxvkm+PmcWkgKAqpo5MT2LT1EdTI/zxI+DAi99hsYKmodAoWgPewDNtRsremQIadnqzaPNMQbcgd89N9Ext6zIcArAViz+XpoAR80HCy8PVo3Ss+bzZJainymqGK65ulYgeHiN0WYTRORE82RXGwvs2vO/r926pZspLt+0vHzlcLQ=="
),
);
Anyway, I'm trying to figure out what it isn't liking. I'm getting a response back that I can use but it doesn't like it during validation and errors out.
The problem is at the OneLogin connector. Maybe a copy&paste error.
You wrote as Audience there:
https://stage.originsystems.co.za/sso-metadata.php
instead of
https://stage.originsystems.co.za/metadata.php
that is why the SAMLResponse contains
<saml:Conditions NotBefore="2016-05-04T09:34:20Z" NotOnOrAfter="2016-05-04T09:40:20Z">
<saml:AudienceRestriction>
<saml:Audience>https://stage.originsystems.co.za/sso-metadata.php</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
that generates when you tried to validate, the error:
https://stage.originsystems.co.za/metadata.php is not a valid audience for this Response
Related to the "Signature validation failed. SAML Response rejected", in the signature validation process, any change on the XML affect the result, I don't know how you extracted the SAMLResponse, but if you took a pretty printed version of the XML , it always gonna give you validation error. If available, use the based64encoded version, use that decode tool and use the result on the validation tool.
I figured this out. You were correct pitbulk. Another developer had written some code that sanitized incoming Requests. This was causing the validation to fail... understandable. Thanks for the help, pitbulk.
I am working on test cases and getting Signature validation failed error on validating the SAML response . Please help me in identifying which parameters are responsible for Signature Creation and Validation
@akash-goel have you solved that issue?
@pitbulk Hey could you please help me out with same "Signature validation failed. SAML Response rejected" issue.
Below is my saml2_settings.php file <?php
//This is variable is an example - Just make sure that the urls in the 'idp' config are ok. //$idp_host = 'https://idp.ssocircle.com:443'; $idp_host = 'https://passport.soaer.com'; return $settings = array(
/**
* If 'useRoutes' is set to true, the package defines five new routes:
*
* Method | URI | Name
* -------|--------------------------|------------------
* POST | {routesPrefix}/acs | saml_acs
* GET | {routesPrefix}/login | saml_login
* GET | {routesPrefix}/logout | saml_logout
* GET | {routesPrefix}/metadata | saml_metadata
* GET | {routesPrefix}/sls | saml_sls
*/
'useRoutes' => true,
'routesPrefix' => '/saml2',
/**
* which middleware group to use for the saml routes
* Laravel 5.2 will need a group which includes StartSession
*/
'routesMiddleware' => ['web'],
/**
* Indicates how the parameters will be
* retrieved from the sls request for signature validation
*/
'retrieveParametersFromServer' => false,
/**
* Where to redirect after logout
*/
'logoutRoute' => '/',
/**
* Where to redirect after login if no other option was provided
*/
'loginRoute' => '/loggedin',
/**
* Where to redirect after login if no other option was provided
*/
'errorRoute' => '/error',
/*****
* One Login Settings
*/
// If 'strict' is True, then the PHP Toolkit will reject unsigned
// or unencrypted messages if it expects them signed or encrypted
// Also will reject the messages if not strictly follow the SAML
// standard: Destination, NameId, Conditions ... are validated too.
'strict' => false, //@todo: make this depend on laravel config
// Enable debug mode (to print errors)
'debug' => true, //@todo: make this depend on laravel config,
// If 'proxyVars' is True, then the Saml lib will trust proxy headers
// e.g X-Forwarded-Proto / HTTP_X_FORWARDED_PROTO. This is useful if
// your application is running behind a load balancer which terminates
// SSL.
'proxyVars' => false,
// Service Provider Data that we are deploying
'sp' => array(
// Specifies constraints on the name identifier to be used to
// represent the requested subject.
// Take a look on lib/Saml2/Constants.php to see the NameIdFormat supported
'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
// Usually x509cert and privateKey of the SP are provided by files placed at
// the certs folder. But we can also provide them with the following parameters
'x509cert' => '',
'privateKey' => '',
// Identifier (URI) of the SP entity.
// Leave blank to use the 'saml_metadata' route.
'entityId' => 'url:test:laravel:php',
// Specifies info about where and how the <AuthnResponse> message MUST be
// returned to the requester, in this case our SP.
'assertionConsumerService' => array(
// URL Location where the <Response> from the IdP will be returned,
// using HTTP-POST binding.
// Leave blank to use the 'saml_acs' route
'url' => '',
),
// Specifies info about where and how the <Logout Response> message MUST be
// returned to the requester, in this case our SP.
// Remove this part to not include any URL Location in the metadata.
'singleLogoutService' => array(
// URL Location where the <Response> from the IdP will be returned,
// using HTTP-Redirect binding.
// Leave blank to use the 'saml_sls' route
'url' => '',
),
),
// Identity Provider Data that we want connect with our SP
'idp' => array(
// Identifier of the IdP entity (must be a URI)
// 'entityId' => $idp_host . '/saml2/idp/metadata.php', // 'entityId' => $idp_host . '/sso/SSOPOST/metaAlias/publicidp', 'entityId' => $idp_host . '/idp/shibboleth',
// SSO endpoint info of the IdP. (Authentication Request protocol)
'singleSignOnService' => array(
// URL Target of the IdP where the SP will send the Authentication Request Message,
// using HTTP-Redirect binding.
// 'url' => $idp_host . '/saml2/idp/SSOService.php', // 'url' => $idp_host . '/sso/SSORedirect/metaAlias/publicidp',
//'url' => $idp_host . 'idp/profile/Shibboleth/SSO',
//'url' => $idp_host . '/idp/profile/SAML2/POST/SSO',
//'url' => $idp_host . '/idp/profile/SAML2/POST-SimpleSign/SSO',
'url' => $idp_host . '/idp/profile/SAML2/Redirect/SSO',
),
// SLO endpoint info of the IdP.
'singleLogoutService' => array(
// URL Location of the IdP where the SP will send the SLO Request,
// using HTTP-Redirect binding.
// 'url' => $idp_host . '/saml2/idp/SingleLogoutService.php', 'url' => $idp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ABo2swaTAdBgNVHQ4EFgQU+rnx825ekeRYh9LChJuiFIqqDp8wSAYDVR0RBEEwP4IScGFzc3BvcnQuc29hZXIuY29thilodHRwczovL3Bhc3Nwb3J0LnNvYWVyLmNvbS9pZHAvc2hpYmJvbGV0aDANBgkqhkiG9w0BAQsFAAOCAQEAfA3cKFh2C2Tst3G7RRq6Isjg//RkZ7Q7VQ70IYdx/vW7dz3sqBq2UXtkejvDM7kEdRRLW2mlqoEWrdTfdrVEWjUOsALJIF6QQHps6B/Zmj5nhzFKED8q1WwQxjStRgqhhjweG184gSdlxylzziv5OGjfJu+iHGAMgpOlk6BzGZ3f+95axx9wBM3mNJuYkE3LT5Klxj3BzED7GOjAjbsyz8vga/PE1aTiYqiCTVnfnjf77WZQ+J8P25kqCNHmAUyOeXSGfyiaxMxDvsPKA++FiRsQwzGOZQd/8GMwWJvG+4ee0dzrd5hc999lzAngxHdaPi7ZCZZNUFCAhb/Rj4rV3Q==', /*
(openssl x509 -noout -fingerprint -in "idp.crt" to generate it) */ // 'certFingerprint' => 'SHA-256', 'certFingerprintAlgorithm' => 'sha256',
),
/**
*/ // Security settings 'security' => array(
/* signatures and encryptions offered /
// Indicates that the nameID of the
// Indicates whether the
// Indicates whether the
// Indicates whether the
/ Sign the Metadata False || True (use sp certs) || array ( keyFileName => 'metadata.key', certFileName => 'metadata.crt' ) / 'signMetadata' => false,
/ signatures and encryptions required /
// Indicates a requirement for the
// Indicates a requirement for the
// Indicates a requirement for the NameID received by // this SP to be encrypted. 'wantNameIdEncrypted' => false,
// Authentication context. // Set to false and no AuthContext will be sent in the AuthNRequest, // Set true or don't present thi parameter and you will get an AuthContext 'exact' 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport' // Set an array with the possible auth context values: array ('urn:oasis:names:tc:SAML:2.0:ac:classes:Password', 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509'), 'requestedAuthnContext' => true, ),
// Contact information template, it is recommended to suply a technical and support contacts 'contactPerson' => array( 'technical' => array( 'givenName' => 'name', 'emailAddress' => 'no@reply.com' ), 'support' => array( 'givenName' => 'Support', 'emailAddress' => 'no@reply.com' ), ),
// Organization information template, the info in en_US lang is recomended, add more if required 'organization' => array( 'en-US' => array( 'name' => 'Name', 'displayname' => 'Display Name', 'url' => 'http://url' ), ),
/* Interoperable SAML 2.0 Web Browser SSO Profile [saml2int] http://saml2int.org/profile/current
'authnRequestsSigned' => false, // SP SHOULD NOT sign the
);
@techmatevaibhav "Signature validation failed. SAML Response rejected" error happens when SP rejects the Signature of the SAMLResponse. That happens when the SAMLResponse is manipulated, or when the public certificate of the IdP registered on the SP is wrong. Can you try to validate the SAMLResponse at https://www.samltool.com/validate_response.php ?
Is the Assertion encrypted of the SAMLResponse encrypted? What software uses the IdP?
Hi I am not able to verify signature at https://www.samltool.com/validate_response.php ?
I am generating signature string distinguishedName = ConfigurationManager.AppSettings["IssuerTokenCertificateDistinguishedName"];
X509Certificate2 certificate = FederationUtilities.LookupCertificate(storeName, storeLocation, distinguishedName);
SecurityKeyIdentifier ski = new SecurityKeyIdentifier(new SecurityKeyIdentifierClause[] { new X509SecurityToken(certificate).CreateKeyIdentifierClause
If you introduce a simple space in the XML, then the Signature Validation process will fail. Maybe when the system is pretty-printing the XML in your console is introducing them.
I recommend you to base64encode the XML before printing it, then copy the result and then base64decode it, and validate the XML generated
can you please give me your email so that i will send you the response . Need help in priority
I'm getting the error in the title above from php-saml. I've set up a SimpleSamlPHP IdP on the same server as my SP application using php-saml. The IdP is for testing IdP responses on my dev machine.
My SP metadata looks like this...
I spit that out with a json_encode but it is in an array in PHP. The response I'm getting back from the IdP is...
When I plug the response into OneLogin's "Validate SAML Response" tool it tells me "Error parsing xml string". However, no other validator I put it in gives me a problem. I've been banging my head against this problem for a while now.
A bit of background... I've got two servers. The STAGE server can see out to the web and can be seen from outside as well. On that server I use OneLogin as an IdP and everything seems to work fine. However, my Dev machine can't be seen from outside the local network and so OneLogin can't send a response back to me. That's why I'm using SimpleSAML to set up an IdP locally so I can test. I say that to say, I'm not married to SimpleSAML. If there's a way to set up php-saml to do the some thing, I'll use it. Or if you have another suggestion that might work.
Thanks