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
Web server app using sdk
Tags: authentication
May 13, 2021 at 3:00am   •   1 replies  •  0 likes
Chris Moreno

I am trying to use the ring central javascript sdk. My created up is for our users only, it is a web server app. I am not clear on how needs to be used to log in and run an endpoint.

I am running this but I keep getting unauthorized for this grant type.


let rcsdk = new RC( {server: RINGCENTRAL_SERVER, clientId: RINGCENTRAL_CLIENTID, clientSecret: RINGCENTRAL_CLIENTSECRET} );
rcsdk
    .login({
        username: 'myusername', // phone number in full format
        extension: '', // leave blank if direct number is used
        password: 'mypassword'
    })
    .then(function(response) {
        console.log(response)
    })
    .catch(function(e) {
        console.log(e.message)
    });

any idea?

1 Answer
answered on May 13, 2021 at 11:39am  

Login that way is the "Password Flow" authentication so your app's Platform type needs to be "Server only- No UI" type.


 0
on May 13, 2021 at 12:45pm   •  0 likes

@Phong Vu so if my app is web server, what all do I need?

on May 13, 2021 at 5:28pm   •  0 likes

Then you have to implement 3-legged OAuth authentication. See the getting started sample code here.

on May 14, 2021 at 1:39am   •  0 likes

@Phong Vu Oh, I see. If I choose an application with password flow, is the password the credentials that I used to login into Ring Central? along with the clientid, secret and server? (as below)

screen-shot-2021-05-14-at-33906-am.png

on May 14, 2021 at 7:08am   •  0 likes

The user login credentials is the username and password of users under your sandbox account (or your production account if you have graduated your app to the production).

screen-shot-2021-05-14-at-70224-am.png



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