question

Sam Amir avatar image
Sam Amir asked Sam Amir commented

Received "OAU-140: Invalid Resource Owner Credentials" error

I need to have a possibility to send sms form different users with different phone numbers. Support Team recommended me setup connection from different users. The app I`m creating is integration between RingCentral and Salesforce.

I created another test account, made the same in there and it works. In this account I got the error but all credentials are correct. I am using password from service as required.

Client Id: B6pLS5gTR4a3wseciBk2fg

ringcentral apperrors
1 comment
1 |3000

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

Sam Amir avatar image Sam Amir commented ·

@Phong Vu Could you please help

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

I don't know what you meant by saying "creating another test account.". Can you give me the test account id or its main company number?.

I see that you have 2 apps, one is in the production and one is still in the sandbox environment. The app client id "B6pLS5gTR4a3wseciBk2fg" is still in the sandbox environment. And there is only 1 user extension in your sandbox account (and that is you).

To login the app in the sandbox environment, you have to use login credentials of user(s) who are under the sandbox account. Thus, not any user under the production account.

There is also a fundamental problem in the public app which was graduated by our support engineer. You cannot have a public app with Server only/ (No UI) platform type.

I am not sure about your use case yet, but here are the options:

  1. If you want different users with different phone numbers under the SAME RINGCENTRAL ACCOUNT to use your app, you need a private app with the "Server/Web" platform type.

  2. If you want different users with different phone numbers from DIFFERENT RINGCENTRAL ACCOUNTS to use your app, you need a public app with the "Server/Web" platform type.

Let me know which option above is your use case so I can help to change your app settings accordingly.

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.

Sam Amir avatar image Sam Amir commented ·

@Phong Vu I created totally different account using another email addess and it worked. But it doesn`t matter for now.

Correct, I have 2 apps. One in the production has authorization using JWT token. Another one I created to test the basic authorization because I need have a possibility to send messages from different user`s phone numbers.

You sad: "To login the app in the sandbox environment, you have to use login credentials of user(s) who are under the sandbox account. Thus, not any user under the production account." -- So how can I change that. I need some users for that.

I suppose that private app is my case. I have account with users in there.

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

You wrote: "To login the app in the sandbox environment, you have to use login credentials of user(s) who are under the sandbox account. Thus, not any user under the production account." -- So how can I change that. I need some users for that.

=> Test the app in sandbox, login the app with user(s) under your sandbox account (must have a direct number to send/receive text messages). Then graduate it to the production then you can enable user(s) under the production account to use the app.

You wrote: "I suppose that private app is my case. I have account with users in there."

=> I will change the app to Private app then.

But since you said that you need have a possibility to send messages from different user`s phone numbers, This app "RingCentral app for sending SMS" is not for that because it is a "Password flow" app. It means that you have to hard code the username and password (or create a personal JWT token) to always authenticate that user to send text messages. This will not allow you to send text messages from phone numbers which is not assigned to that user. Instead, you need to implement an app with 3-legged authentication, which allows different users to login the app and send text messages from their own number.

0 Likes 0 ·
Sam Amir avatar image
Sam Amir answered Phong Vu commented

@Phong Vu I am trying to connect using 3-legged authentication and getting the following error:

"errorCode" : "OAU-165",

message" : "Sandbox client is not allowed: B6pLS5gTR4a3wseciBk2fg"

sample code I am using:

Http http = new Http();

HttpRequest req = new HttpRequest();

req.setEndpoint('https://platform.ringcentral.com/restapi/oauth/authorize?response_type=code&redirect_uri=https://sandbox5-mountainmanagementgroup.cs211.force.com/services/apexrest/AccountsList&client_id=B6pLS5gTR4a3wseciBk2fg');

req.setMethod('GET');

HttpResponse response = http.send(req);

System.debug('response.getStatus : ' + response.getStatus());

System.debug('res.getBody()' + response.getBody());


I am using correct client id, so could you help me resolve the issue

1 comment
1 |3000

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

Sam Amir avatar image
Sam Amir answered Sam Amir commented

@Phong Vu

I am trying to login via 3-legged authorization but got the error with invalid credentials. All credentials are correct, also to be sure I changed the password but it didn`t help.

I made a test:
As I texted before I`ve created another account for testing and succesfully authorized with that credentails.

I had issue with phone number(I coudn`t send sms from sandbox account) with jwt authorization. Also tried before to authorize with password authorization and got similar error. All of those authorizations I tried in totally different created account and all work. But not with this account. So I suppose the issue in particular account

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 ·

I am lost and I cannot help you better when you're ignoring my previous answer where you clearly made a mistake in mixing the sandbox app and the production platform. After 8 days you come back and provide no clue of what you are doing. What do I suppose to help and check when you just wrote "But not with this account."?

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

@Phong Vu Where I can schedule the call with support?

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