cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2402
Views
2
Helpful
13
Replies

Unable to get ID token

hemisuser1
Level 1
Level 1

Hi,

While Generating ID-tokens with WebEx integration I am getting the following error for the token endpoint request:

The request is missing a required parameter, includes an invalid parameter value, or is otherwise malformed. 

From the response unable to understand which filed is missing or malformed, any help on this will be highly appreciated.

Thanks.

 

1 Accepted Solution

If you're referring to the response from /v1/access_token, perhaps this note is relevant

dstaudt_0-1681237404471.png

 

View solution in original post

13 Replies 13

dstaudt
Cisco Employee
Cisco Employee

This is working Node/Express sample might be helpful: https://github.com/CiscoDevNet/webex-login-with-webex-sample

hemisuser1
Level 1
Level 1

Somehow managed to get the id token with WebEx. Now I am not getting the email claim in ID token even though passed scopes as "openid email". Did anyone face this issue? any configuration I am missing?

If you're referring to the response from /v1/access_token, perhaps this note is relevant

dstaudt_0-1681237404471.png

 

dtibbe
VIP
VIP

Can you share your request (obfuscating your token)?

Or you can share your Tracking ID with devsupport, they may look into the issue using that id

Following are the details of the request:

https://idbroker.webex.com/idb/oauth2/v1/access_token
Authorization: Basic QzFhNmQ1NjU1MWxxxxxxxxxxxxxxxxxxxxxTUxYTM1OGVhMg==

grant_type=authorization_code&code=MjZjNjZkYTctYTc1ZS00OGRkLTgwMxxxxxxxx460f-b134-dd9f31b56890&redirect_uri=<redirect_url>&client_id=<client_id>&code_verifier=CgIio9sobjR6cK30UamH4CuRqfKTa4qf6tc2rSxDVk8

Thanks

Hi @hemisuser1,
Thanks for sharing the details here.
Since I was going through the Error you're facing here i.e., "The request is missing a required parameter, includes an invalid parameter value, or is otherwise malformed." and after looking at your Request payload, I think I understand why it's throwing that error. 

In general for this API Request, there are 5 query parameters which are crucial and those are - 

  • client_id
  • client_secret
  • grant_type
  • redirect_uri
  • code

Now, in your Request payload - I can already find the most of the fields are matching, however I see you're using a parameter code_verifier
I don't think this an acceptable parameter for this Request. The last one should be mentioned as client_secret.
You can refer to the screen shot as Jeff has shared in his reply, since all these parameters need to be inserted following 'Content-Type: application/x-www-form-urlencoded' and this is crucial.
So, in plain text with curl format, your Request should be - 

curl --location --request POST 'https://webexapis.com/v1/access_token' \

--header 'Content-Type: application/x-www-form-urlencoded' \

--data-urlencode 'grant_type=authorization_code' \

--data-urlencode 'client_id=<clientId>' \

--data-urlencode 'client_secret=<clientSecret>' \

--data-urlencode 'redirect_uri=<uri>' \

--data-urlencode 'code=<code>'

And, please note - you don't need any Token to run this API.

Just to share, if you feel that first generating the code from OAuth Authorization URL is hectic before running the actual API Request, here is a Blog we've posted very recently to generate token from Postman in very very simple few steps.
I hope this blog might help you here - https://developer.webex.com/blog/generating-an-oauth-token-pair-using-a-webex-integration

Regards,
Sandip

No luck even after removing the 'code_verifier' paramater.

Please remove the basic auth sample!

@Jeff Marshall 

Changing auth type to post_secret, changed error to  {"error":"invalid_grant","error_description":"The provided access grant is invalid, expired, or revoked.","trackingID":"NA_4f91c72c-4f4e-4832-a09d-94db99c3f232"} 

That error indicates that the auth code you're trying to use has already been used or is in some way not valid. The Auth code is one-time use and is only valid for a few minutes. If you're trying to use the same one then you'll need to generate a new one and then attempt to exchange it for your access token.

Using the code one time only so not sure why the error. JFYI I am using a free trial Webex account is that causing these issues? 

Then possibly it's how you're making the request. The parameters should all be sent in the body of the request with content-type:application/x-www-form-urlencoded
This is a screenshot of what a request would look like in Postman.
Screenshot 2023-03-28 at 11.18.48 AM.png

The request sent is URL encoded but getting an above error. Not sure what is wrong?