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
Authention issue while getting token using Auth code ,3-legged oauth code flow error
Tags: authentication, rest api, errors
Jun 1, 2021 at 3:57am   •   1 replies  •  0 likes
Roshna N

Hi All,

We are using the 3-legged api flow mentioned in the below documentation.
REFERENCE URL: https://developers.ringcentral.com/guide/authentication/auth-code-flow

STEP 1: Login URL, where user is redirected to the ringcentral login page for authentication and concent.

https://platform.ringcentral.com/restapi/oauth/authorize?response_type=code&redirect_uri=<my_uri>&client_id=<client_id>&display=&prompt=

STEP 2: We are successfully receiving the code in response to our redirect URI specified. When we make a second request to receive the token we are getting the following error message.

*REQUEST URL:* https://platform.devtest.ringcentral.com/restapi/oauth/token

*REQUEST TYPE:* POST

*REQUEST HEADER*

"Accept"=> "application/json",
"Content-type"=>"application/x-www-form-urlencoded; charset=UTF-8",
"Content-Length"=>144,
"Authorization"=>"Basic BASE64CODE({CLIENTID}:{ CLIENTSECRET})

*REQUEST BODY PARAMETERS*
"grant_type" => "authorization_code",
"code" => {RECEIVEDCODE},
"client_id" => {CLIENTID},
"redirect_uri" => {REDIRECTURL},

*RESPONSE WE ARE GETTING*

{
"error" : "invalid_grant",
"errors" : [ {
"errorCode" : "OAU-222",
"message" : "Account does not exist"
} ],
"error_description" : "Account does not exist"
}

Please let us know the solution to this.

Thanks in advance.

1 Answer
answered on Jun 1, 2021 at 10:56am  

Everything looks correct. Just double check your parameters and retry. Or use one of the RingCentral SDKs to try and make sure you can login with your app and user credentials.


 0



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