Cannot authorize with RingCentral C# Client

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
Cannot authorize via C# Client

sample code below:

 rc = new RestClient(Config.Instance.appKey, Config.Instance.appSecret, false);
 var result = rc.Authorize(Config.Instance.username, Config.Instance.extension, Config.Instance.password).Result;

The error is "Request to https://platform.devtest.ringcentral.com/restapi/oauth/token failed with status code 400 (Bad Request)."


In case I try to use C# SDK, I always get following response error:


{
  "error" : "invalid_grant",
  "error_description" : "Invalid resource owner credentials."
}
Photo of Evgeny Alhovik

Evgeny Alhovik

  • 70 Points

Posted 2 years ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
Please check the password. The error message means your password is invalid.
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
I just tried an invalid password and I got the same error message.
Photo of e z U R s dot com

e z U R s dot com

  • 72 Points
Am I right to say that same password used to login to https://developer.ringcentral.com ? I can log in there with my password. Even I can send sms via API Explorer 
Photo of e z U R s dot com

e z U R s dot com

  • 72 Points
One more error message I get when I use C# Client 
{
  "error": "invalid_client",
  "errors": [
    {
      "errorCode": "OAU-153",
      "message": "Invalid client: ",
      "parameters": [
        {
          "parameterName": "client_id",
          "parameterValue": ""
        }
      ]
    }
  ],
  "error_description": "Invalid client: "
}
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
There are two kinds of RingCentral apps: private and public.

Please double check. Is your app public or private? If it's private, only certain users can login. It might be the root cause of the problem.
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
Please login https://developer.ringcentral.com, find your app, there is a "Credentials" tab where you can find user accounts. Please try to use user accounts there to login instead.
Photo of John Wang

John Wang, Official Rep

  • 5,654 Points 5k badge 2x thumb
There are two types of accounts for development:

Production credentials - this is used for production use 


Sandbox (test) credentials - this is for the test environment


When you are accessing anything with "devtest" in the domain, you should use your Sandbox credentials which are provided in the Developer Portal under the Credentials tab as mentioned by Tyler