03-27-2023 01:39 AM
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.
Solved! Go to Solution.
04-11-2023 11:24 AM
If you're referring to the response from /v1/access_token, perhaps this note is relevant
04-11-2023 11:29 AM
This is working Node/Express sample might be helpful: https://github.com/CiscoDevNet/webex-login-with-webex-sample
04-11-2023 02:42 AM
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?
04-11-2023 11:24 AM
If you're referring to the response from /v1/access_token, perhaps this note is relevant
03-27-2023 01:50 AM
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
03-27-2023 02:47 AM - last edited on 03-27-2023 04:56 AM by Jeff Marshall
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
03-28-2023 08:28 PM
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 -
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
04-10-2023 04:58 AM
No luck even after removing the 'code_verifier' paramater.
03-27-2023 02:56 AM
Please remove the basic auth sample!
03-27-2023 03:36 AM
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"}
03-27-2023 05:06 AM
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.
03-27-2023 10:04 PM
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?
03-28-2023 08:22 AM
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.
04-10-2023 04:59 AM
The request sent is URL encoded but getting an above error. Not sure what is wrong?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide