Hello Team,
I am trying to implement an Okta-to-Okta token exchange using the SAML2 assertion grant.
My setup is fully within the same Okta org, and I am using:
-
A SAML 2.0 Application for user authentication
-
An OIDC (OAuth) Application to issue tokens
-
The OIDC app has urn:ietf:params:oauth:grant-type:saml2-bearer enabled
Flow:
-
User logs in through the SAML 2.0 application (Okta is the IdP).
-
I receive the SAMLResponse at my ACS endpoint.
-
I extract the raw SAML Assertion and encoded into base 64 format.
-
I POST it to the Okta
/tokenendpoint with the SAML2 assertion grant. -
Okta returns an assertion error such as “assertion’ is not a valid SAML 2.0 Assertion”.
Problem:
Despite everything appearing correct, Okta still rejects the assertion.