I'm trying to get an oauth access token using the SAML Assertion oauth flow and getting back the generic invalid assertion error message.
{
"error": "invalid_grant",
"error_description": "invalid assertion"
}
I know there are a number of issues that could cause this error but feel like I've tried just about everything and not sure what I am missing.
- Signed SAML assertion has been validated with the SF SAML assertion validator.
- I am using the following to base64URL encode the assertion http://www.simplycalc.com/base64url-encode.php.
- The endpoint matches oauth 2.0 token endpoint in the SSO config.
- The recipient in the assertion was changed to the oauth endpoint. e.g
https://MYDOMAIN.cs67.my.salesforce.com/services/oauth2/token?so=00D0n0000000QUx
curl command
curl -X POST https://MYDOMAIN.cs67.my.salesforce.com/services/oauth2/token -d "so=00D0n0000000QUx" -d "grant_type=assertion" -d "assertion_type=urn%3Aoasis%3Anames%3Atc%3ASAML%3A2.0%3Aprofiles%3ASSO%3Abrowser" -d "assertion=PD94bW..."