cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
94575
Views
48
Helpful
15
Replies

Cisco AnyConnect with Azure Single Sign-On failing with problem retrieving SSO cookie

Michael Fox
Level 1
Level 1

I am having a problem with my configuration of AnyConnect authentication using Azure Single Sign-On. This configuration was done following the "Configure a SAML 2.0 Identity Provider (IdP)" & "Example SAML 2.0 and Onelogin" sections of the following Cisco CLI Book 3 document:

 

https://www.cisco.com/c/en/us/td/docs/security/asa/asa96/configuration/vpn/asa-96-vpn-config/webvpn-configure-users.html

 

 When connecting I am getting the message "Authentication failed due to problem retrieving the single sign-on cookie." and within the ASDM logs I am getting "Failed to consume SAML assertion. reason: The profile cannot verify a signature on the message."

 

So far I have double checked my certificates, URL's and edited the request signature with no change.

 

Any suggestions would be greatly appreciated.

1 Accepted Solution

Accepted Solutions

Michael Fox
Level 1
Level 1

After sending Cisco all the debug logs, DART logs, metadata XML files (from SSO) they cam back to me with the following solution.

 

I’ve done research regarding SAML configuration on ASA and found that changes on SAML configuration do not take effect immediately, it is described in this bug:

 

CSCvi23605 (https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvi23605/?reffering_site=dumpcr) - Re-enable SAML to make config changes take effect.

 

SAML on ASA is using lasso library. If we need to make changes take effect and refresh the memory, we can only either re-enable or reboot to destroy the old SAML IdP in memory and create a new one. This is the limitation of the lasso library. So yes, it is kind of cached and this is limitations of used library.
Regarding the tunnel-group. I found only a bug where you can use only one certificate for the same SAML IDP config on the ASA:

 

In this situation I suspect that some configuration (like signature algorithm or the certificate) was not applied properly due to this defect. In this situation I propose the following:

Re-enable SAML Auth in tunnel group:

ciscoasa(config-tunnel-webvpn)# no saml identity-provider https://...

ciscoasa(config-tunnel-webvpn)# saml identity-provider https://...

 

Hope this helps anyone else looking for the solution to this.

View solution in original post

15 Replies 15

Michael Fox
Level 1
Level 1

After sending Cisco all the debug logs, DART logs, metadata XML files (from SSO) they cam back to me with the following solution.

 

I’ve done research regarding SAML configuration on ASA and found that changes on SAML configuration do not take effect immediately, it is described in this bug:

 

CSCvi23605 (https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvi23605/?reffering_site=dumpcr) - Re-enable SAML to make config changes take effect.

 

SAML on ASA is using lasso library. If we need to make changes take effect and refresh the memory, we can only either re-enable or reboot to destroy the old SAML IdP in memory and create a new one. This is the limitation of the lasso library. So yes, it is kind of cached and this is limitations of used library.
Regarding the tunnel-group. I found only a bug where you can use only one certificate for the same SAML IDP config on the ASA:

 

In this situation I suspect that some configuration (like signature algorithm or the certificate) was not applied properly due to this defect. In this situation I propose the following:

Re-enable SAML Auth in tunnel group:

ciscoasa(config-tunnel-webvpn)# no saml identity-provider https://...

ciscoasa(config-tunnel-webvpn)# saml identity-provider https://...

 

Hope this helps anyone else looking for the solution to this.

Wanted to add one additional piece to this, if you require multiple TG's and, as such, multiple Azure apps, you can import your own certificate which may be used across multiple apps for SAML in Azure.

 

https://docs.microsoft.com/en-us/azure/active-directory/saas-apps/cisco-anyconnect

 

 

Hi,

 

We are not able to figure out the multiple tunnel-groups with IDP's certificate as we can only specify one trustpoint under webvpn IDP section. Has someone done it before?

Thanks

 

Only one is currently supported.

The way to get multiple tunnel-groups using SAML is to have an Authorization server send an attribute to change the user's tunnel-group. For now, the SAML iDP cannot also act as an Authorization server (although I hear that is a feature on the roadmap) so you need to use something like ACS or ISE as the Authorization server.

You may try to create a self signed certificate on Azure side and import it to each Cisco anyconnect application, so that you are using the same cert (for exemple only) :

 

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout MyPrivKey.key -out MyCert.crt
openssl pkcs12 -inkey MyPrivKey.key -in MyCert.crt -export -out Azure_SAML_for_Cisco_Anyconnect.pfx

One other cause of this error is that the connection group is case sensitive.  So the any connect metadata URL that you enter into the idP configuration should reflect the right case.

 

Example:

If the connection group is named CONNECTION-GROUP

then the metadata URL you enter into Azure idP should be

https://<VPN URL>/saml/sp/metadata/CONNECTION-GROUP

If you enter  https://<VPN URL>/saml/sp/metadata/connection-group instead, it will also yield the "Authentication failed due to problem retrieving the single sign-on cookie."

 

 

Andreas Foerby
Level 1
Level 1

Hi. 
I'm having the same issue, and have tried the proposed fix, with no luck. 

 

 When connecting I am getting the message "Authentication failed due to problem retrieving the single sign-on cookie." and within the ASDM logs I am getting "Failed to consume SAML assertion. reason: The profile cannot verify a signature on the message."

 

Any ideas? 

@Andreas Foerby It's usually the certificate you have configured for the iDP (Azure).

1. Double check the Azure side certificate is the one you imported into your ASA as a CA certificate.

2. Double check that the very same certificate bound to a trustpoint and that the trustpoint is the one specified in the "trustpoint idp" section of the saml config in the webvpn section of the ASA configuration.

As noted, if you make any change to the saml configuration, you need to remove and re-add it to the tunnel-group ("connection profile" in ASDM)

Andreas Foerby
Level 1
Level 1

@Marvin Rhoads 
I have double checked the Azure side certificate - OK.
Double checked trustpoints mathing - OK. 
I have tried both removing the saml config from tunnel-group and added it again, but also rebooted the appliance. 

Time is synchonized with a public NTP server. 

To make sure I don't hit a bug or something like, I have requested an upgrade to recommended release (ASA 9.14.2). 

Will give you an update after.  

Andreas Foerby
Level 1
Level 1

Have updated the firewall now to 9.14.2, but the error is still coming. 

I tried to do a debug webvpn saml 255 while trying which gave me this output: 

 


May 03 13:42:57
[SAML] build_authnrequest:
https://login.microsoftonline.com/.................

[SAML] saml_is_idp_internal: getting SAML config for tg AnyConnect_AAD_SAML
AnyConnect_AAD_SAML
May 03 13:42:57
[SAML] consume_assertion:
PHNhbWxwOlJlc3BvbnNlIElEPSJfMGU5MmJkMjUtOTE5Zi00ZjBjLWI5NWUtN2RkMTI1OGJkNmUzIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAyMS0
wNS0wM1QxMTo0Mjo1Ny4zNjhaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly92cG4uc3ZlbmRzZW4tc3BvcnQuY29tLytDU0NPRSsvc2FtbC9zcC9hY3M/dGduYW1lPU
FueUNvbm5lY3RfQUFEX1NBTUwiIEluUmVzcG9uc2VUbz0iXzU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0RCTXFX
cjg3YTRXYjBqSmRKSFU5ZWdHYVhYak1XT2FsTnJGQ1BzblRrYlNuTUdoMGlja2k0Q014UGxWdUFKYVVuWDNxbEVGYVViS05jcmFlZDRMN3krbWxkN2hUZ1FwSEl
VdmVUYnJ0dTRoaEtpZUhuU3g4WEp3NFJMK0s0MTBvYVpOQnJuVldqYVlBeWhUQVVmTEpjUm9hM2JBY2lQRHpCVmdoYVlZVzJ5eW5VM2swQVN2eFk2eTlWaFMwMU
5yVU5mek9WYnU3Qk1Kd0dadVZvNkN4PC9YNTA5Q2VydGlmaWNhdGU+PC9YNTA5RGF0YT48L0tleUluZm8+PC9TaWduYXR1cmU+PFN1YmplY3Q+PE5hbWVJRCBGb
3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjEuMTpuYW1laWQtZm9ybWF0OmVtYWlsQWRkcmVzcyI+QnJpYW4uQmVjaC5MYXVyc2VuQHN2ZW5kc2VuLXNw
b3J0LmNvbTwvTmFtZUlEPjxTdWJqZWN0Q29uZmlybWF0aW9uIE1ldGhvZD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmNtOmJlYXJlciIMay 03 13:42
:57 [Lasso] func=xmlSecOpenSSLEvpSignatureVerify:file=/local/jenkins/workspace/fxplatform/Builds/release__2.8.1_fcs_jubilee
/build-smp-compile/fxos/linux/wrlinux/bitbake_build/tmp/work/corei7-64-wrs-linux/xmlsec1/1.2.20-r1/xmlsec1-1.2.20/src/opens
sl/signatures.c:line=493:obj=rsa-sha256:subj=EVP_VerifyFinal:error=18:data do not match:signature do not match

May 03 13:42:57 [SAML] consume_assertion: The profile cannot verify a signature on the message
May 03 13:42:57
[SAML] consume_assertion:

[saml] webvpn_login_primary_username: SAML assertion validation failed

I have checked again that the certificates matches each other and they are OK! 

bp.brugman
Level 1
Level 1

We had the same issue, we tried all mentioned solutions but non helped. Finally I removed the Microsoft Azure Federated SSO Certificate from the ASA and reinstalled it with same base64 certificate and all worked properly. Hopefully this might help others.

Thanks bp.brugman!

helped a lot and saved our evening!

mhrastinski
Level 1
Level 1

I know this has been solved for four years but I have been recently had a ton of problems with this and got it working. 

 

I have this working on another device and the device I was having issues with under a different profile. We got rid of the old profile and wanted to move the saml configuration to another profile on the device. I modified everything in portal.azure.com to point to the new profile and made the changes. The configuration was based on the guide on the link below.

https://www.cisco.com/c/en/us/support/docs/security/anyconnect-secure-mobility-client/215935-configure-asa-anyconnect-vpn-with-micros.html

 

When I attempted to log in. I got the correct MFA prompts. After i was authenticated, i got the error "Authentication failed due to problem retrieving the single sign-on cookie." I attempted to remove the saml configuration from the tunnel group. That did not work. I reloaded to ASA, which also did not work. The ASA would not generate the XML file at http://URL/saml/sp/metadata/ProfileName . I removed the tunnel group and SAML configuration from the ASA and then rebooted. After a reboot I recreated both and still the XML was not created properly.  

 

I finally just attached the SAML config to another tunnel group and it created the XML file for that group. After that I removed the tunnel group that I was working with and recreated it with all lower case letters in the name instead of all upper case letters. the remainder of the configuration for the tunnel group was unchanged. The XML file for the profile was created and I was able to log in using SAML through Azure. 

 

I could find very little about this issue online. I hope this helps.

J. H.
Level 1
Level 1

Got the same problem here but XML seems to be created fine.
We're running Remote Access using Firepower FTD 7.0.6 though and configuration is done via FMC.

Can't seem to find any logs in FMC from the attempts on that vpn-group.
The IdP works and users get MFA, but AnyConnect client reports "Authentication failed due to problem retrieving the single sign-on cookie."

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: