question

ATT OFFICE AT HAND BILLING avatar image
ATT OFFICE AT HAND BILLING asked ·

Password Flow - errorCode OAU-123 "Client authentication is required"

I have followed the instructions for the Password Flow. Instead of receiving a token, I am receiving error OAU-123 "Client authentication is required."

I am using VBScript so I cannot use any of the provided libraries or examples.

I created a new application in the ringCentral console with the type of Server-only (No UI) and permissions of Read Accounts, SMS, and Webhook.

I have concatenated the app's client ID+":"+client secret, then encapsulated the entire string to base64.

authString=base64Encode(clientId+":"+clientSecret)

I am testing with the sandbox url "https://platform.devtest.ringcentral.com".

My endpoint is "/restapi/oauth/token".

I open an async POST to the url and endpoint.

objHttp.open |POST|, url+endpoint, async

I then set the following request headers.

objHttp.setRequestHeader "Accept", "application/json"
objHttp.setRequestHeader "Authorization", "Basic "+authString
objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"

I post the following data:

"grant_type=password&username="+userName+"&extension=101&password="+password

I get the following response:

{
"error" : "invalid_client",
"errors" : [ {
"errorCode" : "OAU-123",
"message" : "Client authentication is required"
} ],
"error_description" : "Client authentication is required"
}


I have verified that I am using the correct sandbox Client ID and Client Secret. I have tried resetting the user password. I have tried the user email address as the username, and the phone number with and without the leading "+", url encoded and clear. I always receive the same error.

Google searches for this exact wording have returned no results. Nor is this error listed in the RingCentral errors documentation. (https://ringcentral-faq.readthedocs.io/en/latest/errors/).

Any help would be appreciated.

oauthpassword flow
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered ·

I am not sure about vbScript but currently I don't see any issue in your parameters and url to call OAuth token API, not sure about the code though. May be someone else here can help with the code

It may not be issue from your side. I found something similar here:

https://forums.developers.ringcentral.com/questions/285/error-oau-123-authorization-header-is-not-specifie.html

Please check with back-end support team once to make sure issue is not from your side by connecting to devsupport@ringcentral.com

Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ATT OFFICE AT HAND BILLING avatar image
ATT OFFICE AT HAND BILLING answered ·

Thank you for your reply. Using an API debugger (Runscope) I plugged in my code generated parameters and successfully received a token response. At this point I'm convinced that it is the Windows WinHttp object itself causing the issue. I have noticed that if I do not send an Authorization header at all, I get the same response. If I send an invalid Authorization header (just a few characters), then it produces a different error. This leads me to believe that it the Authorization header is not being attached. There may be an issue with the length or content of the authString. I will post any resolution if I find one.

Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.