missing required parameter: client_id

16.6k Views Asked by At

I tried to request a oauth token from hms server, but it always return missing required parameter: client_id to me.

url: https://oauth-login.cloud.huawei.com/oauth2/v3/token?grant_type=client_credentials&client_id=XXX&client_secret=XXX

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

response: 
{
    "sub_error": 20001,
    "error_description": "missing required parameter: client_id",
    "error": 1102
}
2

There are 2 best solutions below

0
On

This is because the params should be set in x-www-form-urlencoded.

url: https://oauth-login.cloud.huawei.com/oauth2/v3/token

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

x-www-form-urlencoded:
grant_type    client_credentials
client_id     XX
client_secret XX
2
On
"sub_error": 20001,
"error_description": "missing required parameter: client_id",
"error": 1102

enter image description here

Based on the error information, and according to this Docs, It can be determined that the client_id field is empty or incorrect.

You could refer to this Docs to set.

enter image description here