<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007IX1aTCATOkta Classic EngineSingle Sign-OnAnswered2026-05-29T18:51:33.000Z2021-11-22T22:37:30.000Z2026-05-29T18:51:33.000Z

LaineK.95757 (Customer) asked a question.

SAML2 Signing: AudienceRestriction' of type 'null' in assertion

Hello,

 

 

 

I am getting the following errors when I am trying to authenticate using SAML2 (SP initiated) using Spring security:

 

 

 

OpenSamlAuthenticationProvider Found 1 validation errors in SAML response [id***************************]: [[invalid_assertion] Invalid assertion [idxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] for SAML response [id***************************]: Condition '{urn:oasis:names:tc:SAML:2.0:assertion}AudienceRestriction' of type 'null' in assertion 'idxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' was not valid.: None of the audiences within Assertion 'idxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' matched the list of valid audiances]

 

2021-11-22 15:15:32,537 http-nio-0.0.0.0-8080-exec-1 DEBUG  DefaultAuthenticationEventPublisher No event was found for the exception org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationException

 

2021-11-22 15:15:32,537 http-nio-0.0.0.0-8080-exec-1 TRACE  Saml2WebSsoAuthenticationFilter Failed to process authentication request org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationException: Invalid assertion [idxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] for SAML response [id***************************]: Condition '{urn:oasis:names:tc:SAML:2.0:assertion}AudienceRestriction' of type 'null' in assertion 'idxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' was not valid.: None of the audiences within Assertion 'idxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' matched the list of valid audiances

 

>  at org.springframework.security.saml2.provider.service.authentication.OpenSamlAuthenticationProvider.createAuthenticationException(OpenSamlAuthenticationProvider.java:694)

 

>  at org.springframework.security.saml2.provider.service.authentication.OpenSamlAuthenticationProvider.process(OpenSamlAuthenticationProvider.java:516)

 

>  at org.springframework.security.saml2.provider.service.authentication.OpenSamlAuthenticationProvider.authenticate(OpenSamlAuthenticationProvider.java:444)

 

>  at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:182)

 

 


This question is closed.
Loading
SAML2 Signing: AudienceRestriction' of type 'null' in assertion
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply