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
Java example of oauth with refresh tokens
Tags: oauth
Nov 9, 2021 at 12:21pm   •   3 replies  •  0 likes
Scott Haley

We have created a method the does the oauth authentication but it will not persist. Can anyone give me a Java example of one? Here is what I have so far.

@Bean(name="ring-central-rest-config")

public RestClient buildRingCentralRestClientUrl() {

RestClient rc = new RestClient(ringCentralClientId, ringCentralClientSecret, ringCentralServerUrl, getOkHttpClient(this.env));

try {

rc.authorize(accountId, extension, password);

}

catch (IOException | RestException e) {

logger.info("error in calling ring central rest client" + e.getMessage());

}

return rc;

}

on Nov 10, 2021 at 6:53am   •  0 likes
rc.authorize(accountId, extension, password);

Why accountId? Is that really your account id and where did you get the id? BTW, where did you learn that?

It must be a main company phone number (if you specify the extension number) or the user phone number or the user's email address.

2 Answers
answered on Nov 10, 2021 at 6:48am  

Yes, our app is set to Issue Refresh Tokens. I am working on the logs.


 1
answered on Nov 9, 2021 at 5:08pm  

screen-shot-2021-11-09-at-50629-pm.pngHi Scott,

Can you share the full log of the resulting exception so we can understand the exact cause of it? Also, did you set "Issue Refresh Tokens" to "Yes" for your app in the developer portal? See attached screenshot of the same.


 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