question

Matthew T avatar image
Matthew T asked Matthew T commented

Authenticate Error (OAU-140), C#

After walking through the setup process to setup a sandbox account and creating a sample application using API examples provided I am unable to get past the authentication. Have tried both sandbox and production account credentials along with multiple password resets on both accounts. Code below;

string RINGCENTRAL_CLIENTID = "myClientID<used copy/paste>";
string RINGCENTRAL_CLIENTSECRET = "myClientSecrete<used copy/paste>";

string RINGCENTRAL_USERNAME = @"sandbox/prod phone #<used copy/paste>";
string RINGCENTRAL_PASSWORD = "getyourownpassword<used copy/paste>";
string RINGCENTRAL_EXTENSION = "101";
bool RINGCENTRAL_PRODUCTION = false;
RestClient restClient;
restClient = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_PRODUCTION);
Task.Run(async () => await restClient.Authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD)).Wait();

I suspect the issue might be in my configuration within the app or site settings, but after having spent enough time digging, I am at a loss.

authentication
1 |3000

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

Phong Vu avatar image
Phong Vu answered

I cannot think of other reasons than somehow you provided wrong login credentials. To make sure if you can login your app with your sandbox credentials, first check if you can login this site https://service.devtest.ringcentral.com. Then use the exact credentials to login your app.

1 |3000

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

Matthew T avatar image
Matthew T answered Matthew T commented

Indeed I am able to login with the same credentials into your linked site. Again, I am only using copy paste to make sure there isn't a single typo just as I did for the login. Could there be a service on ringcentral's part? or the faulty API?

2 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

When you logged in the service web, did you login with or without the extension id? Do you have more than 1 extension? Just to make sure if the credentials does not belong to the extension.

If everything is correct and you still face the problem, give me your app client id.

0 Likes 0 ·
Matthew T avatar image Matthew T Phong Vu ♦♦ commented ·

ClientID "7_ANM_W1R2G0un6mjNg55A"

0 Likes 0 ·
Matthew T avatar image
Matthew T answered Matthew T commented

Logged in without the extension to the web portal, but specified the extension with the API call as per my code in my original post.

3 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

Why did you change your extension number to 777, and you login your app with 101? That is why you cannot login.

1 Like 1 ·
Matthew T avatar image Matthew T Phong Vu ♦♦ commented ·

Thank you. For some reason I thought I was configuring my extension to forward to for testing the ringout feature. Thank you for your assistance.

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ commented ·

Then try w/o specifying the extension number when login your app.

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys