<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
0D54z00007RUGtmCAHOkta Classic EngineAuthenticationAnswered2023-09-07T18:56:06.000Z2022-02-09T22:40:44.000Z2022-02-10T20:09:00.000Z

rahimr.49354 (Customer) asked a question.

Facing Assertion Invalid Issue in SAML 2.0 Assertion Grant

We are trying to implement the SAML 2.0 Assertion grant (https://developer.okta.com/docs/guides/implement-grant-type/saml2assert/main/) in our tool. In that, we are using both Identity Provider(IdP) and authorization servers in Okta. When we try to call the token endpoint request using the below sample request body

 

curl --location --request POST 'https://${yourOktaDomain}/oauth2/default/v1/token' \

--header 'Accept: application/json' \

--header 'Content-Type: application/x-www-form-urlencoded' \

--header 'Authorization: Basic MG9hb....' \

--data-urlencode 'grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer' \

--data-urlencode 'scope=openid offline_access' \

--data-urlencode 'assertion=<Base64-encoded assertion>'

 

 

we are getting below error,

 

{

    "error": "invalid_grant",

    "error_description": "'assertion' is not a valid SAML 2.0 Assertion."

}

 

Kindly help us to resolve this issue.

 

Thanks

Barani


  • Hello @rahimr.49354 (Customer)​ 

     

    Thanks for posting.

     

    It might be beneficial to open a case with support as some of the assertion errors provide more detailed messages that we can check on the back end. Some common issues can be:

     

    • The audience/recipient in the SAML Assertion does not match what is setup in the SAML IdP in Okta
    • SAML Assertion is not signed, or algorithm mismatch in Okta SAML IdP setup
    • if using an Org with a custom domain URL, a possible mismatch in issuer using either the Okta domain or custom domain
    • Sending the SAML Response instead of the Assertion

     

     

    There is a sample setup that can be found at https://github.com/emanor-okta/saml-assertion-flow-with-okta

     

    This sample uses an Okta SAML Service App as the external SAML IdP, but running the sample will show what the assertion being sent to Okta looks like and the setup can be viewed.

     

    Let us know if this helps you.

     

     

    Daniela Chavarria.

    Okta Inc.

    Expand Post
This question is closed.
Loading
Facing Assertion Invalid Issue in SAML 2.0 Assertion Grant