We created a Salesforce Connected App which should get its access token using SAML / OAuth2.
The request looks as follows:
https://test.salesforce.com/services/oauth2/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2-bearer&assertion=[SAML_ASSERTION]&saml=[SAML_CODE]
It produces the error message:
400 (Bad Request)
{"error_description":"user hasn't approved this consumer","error":"invalid_grant"}
With grant_type = authorization_code, the salesforce user is prompted with a screen asking him to give the connected app approval, but how is it with grant_type = urn:ietf:params:oauth:grant-type:saml2-bearer ? Will the user also be prompted? And when? and how will the prompt open? Or is with saml2-bearer or a pre-approval possible?
Thanks for giving me some insights!