Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Invalid signature #560

Open
sameencse opened this issue Mar 27, 2024 · 5 comments
Open

Error: Invalid signature #560

sameencse opened this issue Mar 27, 2024 · 5 comments

Comments

@sameencse
Copy link

Hi,
Integrated mock-saml for 2 of our product. One is working fine and for other product
when hitting the login url page, it is showing the
Error: Invalid signature

Could you please help me how to resolve this issue?
Note : In the server log, i can see it is generating the sp meta data file, which is fine but afterwards no other errors.

@deepakprabhakara
Copy link
Member

That error would typically mean there is a mismatch in either the certificate or the signature of the SAML request. Can you please check the SAML request generation on your side in the case of the 2nd product where it fails.

@sameencse
Copy link
Author

sameencse commented Apr 1, 2024

Hi Thanks for your prompt response.
Tried all the option but no luck
FYI, the same product was working fine with Test Shib and samltest.id but not working with this mock saml
Now, i tried with jumpcloud trail version, it is working fine
I am suspecting there is an issue with Mock SAML. ( even no way to see the console log)

@deepakprabhakara
Copy link
Member

@sameencse If you can provide us with the SAML request, we can investigate.

@sameencse
Copy link
Author

sameencse commented Apr 1, 2024

@deepakprabhakara Please see the information below.
POST https://mocksaml.com/api/saml/sso HTTP/1.1
sec-ch-ua: "Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
Origin: app url
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: navigate
Sec-Fetch-Dest: document
Referer: http app ulr
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en,en-US;q=0.9,en-IN;q=0.8

HTTP/1.1 500 Internal Server Error
ETag: "oy2c1p0p68o"
Content-Length: 24
Date: Mon, 01 Apr 2024 14:20:55 GMT
Connection: keep-alive
Keep-Alive: timeout=5

POST
RelayState: http://app_url/callback?client_name=SAML2Client
SAMLRequest: PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c2FtbDJwOkF1dGhuUmVxdWVzdCB4bWxuczpzYW1sMnA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgQXNzZXJ0aW9uQ29uc3VtZXJTZXJ2aWNlVVJMPSJodHRwOi8vZGV2angyLmplbnphYmFyLm5ldDoxOTI4MC9qZW56YWJhcmZhLXN0dWRlbnRzZWxmc2VydmljZS11aS9jYWxsYmFjaz9jbGllbnRfbmFtZT1TQU1MMkNsaWVudCIgRGVzdGluYXRpb249Imh0dHBzOi8vbW9ja3NhbWwuY29tL2FwaS9zYW1sL3NzbyIgRm9yY2VBdXRobj0iZmFsc2UiIElEPSJfZGU0NTI0MGU4OTJmNGEyNmJkMjM1ZjA3Y2I5OGVmMzEwODkxYjMxIiBJc1Bhc3NpdmU9ImZhbHNlIiBJc3N1ZUluc3RhbnQ9IjIwMjQtMDQtMDFUMTQ6MjA6NTIuOTExWiIgUHJvdG9jb2xCaW5kaW5nPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YmluZGluZ3M6SFRUUC1QT1NUIiBWZXJzaW9uPSIyLjAiPjxzYW1sMjpJc3N1ZXIgeG1sbnM6c2FtbDI9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIEZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOm5hbWVpZC1mb3JtYXQ6ZW50aXR5Ij5odHRwOi8vZGV2angyLmplbnphYmFyLm5ldDoxOTI4MC9qZW56YWJhcmZhLXN0dWRlbnRzZWxmc2Vydm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lPjwvZHM6WDUwOURhdGE+PC9kczpLZXlJbmZvPjwvZHM6U2lnbmF0dXJlPjwvc2FtbDJwOkF1dGhuUmVxdWVzdD4=
SAML:
<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
AssertionConsumerServiceURL="app_acs_url"
Destination="https://mocksaml.com/api/saml/sso"
ForceAuthn="false"
ID="_de45240e892f4a26bd235f07cb98ef310891b31"
IsPassive="false"
IssueInstant="2024-04-01T14:20:52.911Z"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Version="2.0"
>
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"
>app url</saml2: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/2001/04/xmldsig-more#rsa-sha256" />
<ds:Reference URI="#_de45240e892f4a26bd235f07cb98ef310891b31">
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/2001/04/xmlenc#sha256" />
ds:DigestValueVGWzt5siefWldgMd4uDGShlMNfOVvZJaQfDBvo4XiQk=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
ds:SignatureValue
GTdHh+0cGzcoUol25FwFoqzvzdFwjJ+HDdn5NSH/OlvDSTgK9nngBQGBENPyUvvVW/QJrd/qcdhB
3VH/P/cFCY7zbTanc6z0TWNw4bzvSf8WqnK3+u2jKf2BEHSvZbrOSkM1IlC64hhZM/b79G+MlPQ+
K4cRREQT/+JWT7KvAmACUhNXA2MDkjGw5Lq4k06KubmqQTQ0+4NdiSFrQqCjbW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6/nVmAVDNCn0ww5s
9Nsq96YEubv5QXgR54qibtqtx9yCNZZGWrrOyejufhx3zyoqIlhYx11x+gY0EQDhaes6g5NsLmW3
e/HeFLGt+RbwBIb87o65kx3saGptWoOaOmflPSTZNajkYW0zs4StkMXzT+AkUnDspEHdzC9rgjzk
FgG1XQ0ule8Q48i6pvxFYZ6fNDfNuPNstImYMxqeNMLFchwUsibrLcAjj8BDszSsH20P6JHv2qZk
R8Vfw/SKSWN3BvAZ1KFhHnmgEms/c126scQFCboVlIN/aQ==</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
</saml2p:AuthnRequest>

@deepakprabhakara
Copy link
Member

The digest values don't match when comparing the signature. Would it be possible to give us more information on how you are constructing and signing the SAML request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants