0

I am developing my own OpenIdConnect IdP for logging into my Salesforce. In Salesforce, I created two auth. providers. One is a custom auth. provider (and custom reg. handler), and the other is an OOTB OpenIdConnect one. Both auth. providers point to the same Auth and Token URLs of my IdP, and their buttons are both displayed on the Salesforce login screen.

My custom IdP executes the code flow, so it exposes two endpoints: an /authorize one for the redirect from Salesforce to a login page that then redirects back to Salesforce with the auth code and state, and the other is a /token endpoint that takes the auth code POSTed to it and returns an id_token.

When I login using the custom auth. provider, it works great. The initiate() method redirects the user to the IdP's login screen, which then sends the auth code back to Salesforce, and the handleCallback() method is invoked. This method POSTs to the IdP's /token endpoint and receives a JSON response that looks like:

{ "id_token": "eyJhbGciOiJIUzI1Ni...." }.

The Apex then extracts the id_token from the JSON and performs the next steps to log the user into Salesforce.

However, when I login using the OOTB OIDC auth. provider, I am presented with the error "Id_Token_Error: Missing id_token" after being redirected back to Salesforce from the IdP's login screen. I don't know why this is happening, because I know for a fact that the response to the POST to /token returns a JSON with "id_token" in it. The custom auth. provider can see this in the JSON after POSTing, so why can't the OOTB one see it? After searching online, I was unable to find anything that could help me troubleshoot this.

Any help in figuring out what I'm missing would be very helpful.

2
  • Open a support case, you're unlikely to get an answer here.
    – identigral
    Commented Apr 19 at 18:14
  • This is non-project work and is for a POC. Therefore, the work is being done in a dev org, and I cannot open a support case.
    – Jeff_S
    Commented Apr 19 at 21:09

0

You must log in to answer this question.

Browse other questions tagged .