News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
error" : "invalid_grant",errorCode" : "OAU-140", :Invalid Resource Owner Credentials
Tags: authentication
Mar 25, 2020 at 6:32pm   •   6 replies  •  0 likes
Philip Noble

When I try to ping the URL using httprequest Iam hitting with error


below is the URL:

"https://platform.devtest.ringcentral.com/restapi/oauth/token?grant_type=password&username=180244XXXXX&password=VeXXXXXX&extension=101"

Method : POST

Header Key:

"Authorization" : "Basic OC1qb09WRThUdktQbHppNHdVbjJfdzpHT1ozWE5nblJ1MlhxZUV4dnphUXp3NkwycFFwVGhSWEdPYmwwd2poVkF2dw=="

"Content-Type" : "application/x-www-form-urlencoded;charset=UTF-8"


Error :



400 Bad Request

{

"error" : "invalid_grant",

"errors" : [ {

"errorCode" : "OAU-140",

"message" : "Invalid resource owner credentials"

} ],

"error_description" : "Invalid resource owner credentials"

}


When I try give all above details in web API checker:

http://ringcentral.github.io/api-explorer/#!/Authentication/oauth_token_post

I am able to get the response.


Please let me know if am missing anything here.



6 Answers
answered on Apr 29, 2022 at 6:36am  

@Phong Vu

Hello, I have same issue. All creadentials are correct. Could you please help me


 0
on Apr 29, 2022 at 7:35am   •  -1 likes

Hi Sam,

If you need help, create a new thread and provide some input and ask your question. There are many reasons why it fails. How can I help you when I don't know how exactly you call, what language you use and what is your account or app client id?

Help people to help you in the first place!

answered on Feb 23, 2021 at 7:01am  

I had the same issue, change password from 64 characters to 16 characters then it worked.


 0
answered on Jan 28, 2021 at 3:15pm  

The error resolved when I added "+1" to my ten digit phone number username.


 0
answered on Jan 23, 2021 at 11:43am  

My curl failed, although it had worked previously:

curl https://platform.ringcentral.com/restapi/oauth/token -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic BasicNumberAsString" -d "grant_type=password&username=username&extension=101&password=password"
with the following error:

{

"error" : "invalid_grant",
"errors" : [ {
"errorCode" : "OAU-140",
"message" : "Invalid resource owner credentials"
} ],
"error_description" : "Invalid resource owner credentials"
}%

I attempted to resolve the error by changing my password, but to no avail. Any ideas on how to debug this problem?

 0
on Jan 23, 2021 at 9:38pm   •  1 likes

If you can login your account service web at https://service.ringcentral.com with exactly the same user credentials, then you should be able to log in with your code. Otherwise, the problem is described in the error message.

answered on Mar 26, 2020 at 11:11am  

Thanks!!!

It Worked.


 0
answered on Mar 25, 2020 at 9:14pm  

These params need to be in the post body, not the url

grant_type=password&username=180244XXXXX&password=VeXXXXXX&extension=101"

Something like this in Node JS.

var basic = process.env.RC_CLIENT_ID + ":" + process.env.RC_CLIENT_SECRET;
var headers = {
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            'Accept': 'application/json',
            'Authorization': 'Basic ' + Buffer.from(basic).toString('base64')
            };
var body = querystring.stringify({
              'grant_type' : 'password',
              'username' : encodeURIComponent(process.env.RC_USERNAME),
              'password' : process.env.RC_PASSWORD
            });



 1



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us