I need to pass the client_id along with the get token endpoint in my Okta SSO oauth2 setup

I changed the service provider code to pass this. But now I keep getting this error.
“Cannot supply multiple client credentials. Use one of the following: credentials in the Authorization header, credentials in the post body, or a client_assertion in the post body.”

Also to add more context, the okta setup was working fine till I added the client_id. But I cannot remove the client_id because I have other Identity Providers also integrated and some of them require this.

How can I get around this?

Hi @Sarah are you able to inspect (e.g. Chrome devtools > Network tab) the call going to your IdP to see if you’re sending multiple client_ids?

Could you share a bit more about your environment? its difficult to understand the flow and where the other IdPs play a part.

Yes sure. I can debug and see calls going through to the Idp. and this is what the request looks like.
{
headers: {
Authorization: ‘Basic {auth-token from the authorization endpoint}’,
‘Content-Type’: ‘application/x-www-form-urlencoded’
},
payload: ‘grant_type=authorization_code&code={authorization-code}&redirect_uri={service-provider’s url}&client_id={idp’s client id}’
}

I am using nodejs at the service provider end.

I wonder if its getting confused between the client in your Authorization header and the client_id in the URL? Are both of these for the the same app?

Auth code flow is a multi step process and this looks like step 2. What initiated step one and do you see an authorization code coming back?

The Okta API doc for the openid API is here if you want to check the expected parameters for a call. OpenID Connect & OAuth 2.0 API | Okta Developer

There’s a great overview video on Youtube from Nate Barbattini from Okta which breaks down the each call in a flows which I sometimes refer to.

1 Like

Never gets old! :smile: OAuth 2.0 and OpenID Connect (in plain English) - YouTube

1 Like