question

Icore Software Technologies avatar image
Icore Software Technologies asked Icore Software Technologies commented

Web-phone-js integration with external system using Admin JWT authentication.

I have a Lead management system; I need to integrate Ringcentral with that.

When a staff clicked a lead call button, start the call from browser. and also they need to take an incoming call from browser. If the staff is not available in front of the system, Call will forward to the phone we already mapped.


I am the admin of this Lead manager and I will configure the Ringcentral App details in LeadManager Settings. Staff don't need to authenticate with Ringcentral again.


1. Is this possible with RingCentral ?

2. I tried with web phone JS, But it looks like need to authenticate for each user.

3. I am using PHP & JS for implement this. When I configure app credentials in JS, public can access that. Instead, any option to authenticate from server and use token for JS ? And I noticed only 5 auth request limit also there.


Someone please assist me with this issue.

integrations
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Icore Software Technologies commented

I think you can do that if you implement the authentication using JWT token in the backend and provide a secure way to get the valid tokens from the backend whenever you need to call the platform APIs.

To do that, remove the login function from the client side, and provide a method to get the tokens (you will have to handle multiple users to make sure that your backend returns the right tokens to the right user). Once you have a valid tokens, set the tokens to the platform object and call any API. Here is my untested example. /getToken is your server method that login and return the tokens object.

function getTokens(userId) {
    var getting = $.get( `getToken?userId=userId` );
    getting.done(function( res ) {
      if (res.status == "ok") {
          platform = sdk.platform();
                        await platform.auth().setData(res.tokens)
                        // Call platform API
      }else if (res.status == "error"){
        // handle error
      }
    });
}
1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Icore Software Technologies avatar image Icore Software Technologies commented ·

Thanks for the support, I will try this way, and update here.

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys