question

Ashlesha Shirodkar avatar image
Ashlesha Shirodkar asked Ashlesha Shirodkar commented

Invalid resource owner credentials Invalid Grant using RestClient

I have created a sandbox app. I am using RestClient api . With the credentials from my sandbox. Password is my Ringcentral account pasword.

restClient = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER);

restClient.authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD);


I get error on authentication.

AceRoutingKey: sjc11-c01-ace11.1e06d9b3-8c80-11eb-971a-005056bb8878

11:27:09,559 ERROR [stderr] (test task-9) RoutingKey: SJC11P01

11:27:09,559 ERROR [stderr] (test task-9)

11:27:09,559 ERROR [stderr] (test task-9) {

11:27:09,559 ERROR [stderr] (test task-9) "error" : "invalid_grant",

11:27:09,559 ERROR [stderr] (test task-9) "errors" : [ {

11:27:09,559 ERROR [stderr] (test task-9) "errorCode" : "OAU-140",

11:27:09,559 ERROR [stderr] (test task-9) "message" : "Invalid resource owner credentials"

11:27:09,559 ERROR [stderr] (test task-9) } ],

11:27:09,559 ERROR [stderr] (test task-9) "error_description" : "Invalid resource owner credentials"

11:27:09,559 ERROR [stderr] (test task-9) }


Please let me know what is wrong here? I have setup the sanbox as per teh instruction specidfied for password authentication type.

errors
1 |1500 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.

Phong Vu avatar image
Phong Vu answered

You said "Password is my Ringcentral account pasword." Do you mean the user name and password you login the RingCentral dev portal at https://developers.ringcentral.com? If that is the case, it is wrong.

You can find our sandbox username from the dev portal by select the "Sandbox Accounts" option.

1 |1500 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.

Ashlesha Shirodkar avatar image
Ashlesha Shirodkar answered Phong Vu commented

the user name is phone no. I copied the credentials from the JSON

{"RINGCENTRAL_CLIENTID":"G2IVTQIvRriGGO4QEiIt9Q","RINGCENTRAL_CLIENTSECRET":"Mx8cfv-kRLSpTP0RIB7wfQ43NGUOqjQfWS5_TAjxXU9A","RINGCENTRAL_SERVER":"https://platform.devtest.ringcentral.com","RINGCENTRAL_USERNAME":"+13128589132","RINGCENTRAL_EXTENSION":"101","RINGCENTRAL_PASSWORD":"<YOUR ACCOUNT PASSWORD>"}


What do you mean by Your account password? in credentials it just shows "Active". So i used my Ringcentral account pasword.

1 comment
1 |1500 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.

Don't ask me. That was what you wrote

"I have created a sandbox app. I am using RestClient api . With the credentials from my sandbox. Password is my Ringcentral account pasword."

0 Likes 0 ·
Ashlesha Shirodkar avatar image
Ashlesha Shirodkar answered Ashlesha Shirodkar commented

i changed my sandbox password and passing that password but get error when i use RestClient.java

6 comments
1 |1500 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.

I looked for a sandbox account with this main company number "+13128589132" and found nothing. I doubt that this is the username for your dev portal, not your sandbox

0 Likes 0 ·

RestClient started working now after with new sandbox password. I am now trying to use ok3Http gives 404 error for below url . Basic authentication set in header for {clientid:secretkey}

https://platform.devtest.ringcentral.com/restapi/oauth/token?grant_type=password&username=+13128589132&extension=101&password=#####


0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Ashlesha Shirodkar ·

You said RestClient started working and you still have problem to authenticated a user. So what really worked? Are you using the Java SDK?

0 Likes 0 ·
Show more comments

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