Use Access Token to Log In
Tags: sdk
Jul 13, 2016 at 12:25pm • 7 replies • 0 likes
yash-patel
Hi,
I am trying to use an three-legged authentication in my JavaScript application. I have generated an access_token and now am trying to "Log In" using this token...
In the examples given, something like this has been done:
rcsdk.platform() .login({ username: '18001234567', // phone number in full format extension: '', // leave blank if direct number is used password: 'yourpassword' }) .then(function(response) { // your code here }) .catch(function(e) { alert(e.message || 'Server cannot authorize user'); });
where we can collect username, extension, and password from user to log in. If I have an access token, how should I proceed to log in?
7 Answers
First you need to go through using OAuth with Authorization code grant_Type.
Please check here:
https://developers.ringcentral.com/guide/authentication/oauth
https://developers.ringcentral.com/guide/authentication/auth-code-flow
0
If you continue experiencing issues with this code, I would submit an Issue with logs and details in the Github issue tracker. https://github.com/grokify/ringcentral-demos-oauth/issues
0
Did you follow the Usage information that is in the repository directions which show to use http-server to start the application?
This should not run into CORS issues, but it has been a month or so since I've tested the demos.
This should not run into CORS issues, but it has been a month or so since I've tested the demos.
0
No, he means "authorization code". This code is used to obtain an access_token in a 3-Legged (Authorization Code) Auth Flow.
I would try the 3-Legged OAuth JS Demo in the repository link AK shared above (https://github.com/grokify/ringcentral-demos-oauth/tree/master/javascript).
There is also this older demo code: http://ringcentral.github.io/tutorial/#login-via-3-legged-oauth
I would try the 3-Legged OAuth JS Demo in the repository link AK shared above (https://github.com/grokify/ringcentral-demos-oauth/tree/master/javascript).
There is also this older demo code: http://ringcentral.github.io/tutorial/#login-via-3-legged-oauth
1
Hi Yash,
Once you get the access code from the RedirectUri, you would need to pass an Array of :
<< Key -Value Pairs >>
https://github.com/grokify/ringcentral-demos-oauth/blob/master/javascript/public/index.html#L35
Once you get the access code from the RedirectUri, you would need to pass an Array of :
<< Key -Value Pairs >>
codeonto the login function. For reference, you could take a look at our OAuth Demo in Javascript here on line 35
redirectUri
https://github.com/grokify/ringcentral-demos-oauth/blob/master/javascript/public/index.html#L35
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