question

nick-buchanan avatar image
nick-buchanan asked ·

Embedded Voice oauth error

Following yesterdays webinar on Embedded Voice, I am trying to integrate this into our CRM. I have created test page with  a copy of the example code, but i keep receiving an oauth error. Please can someone advise? Thanks in advance.

include code:
 <script>
  (function() {
    var rcs = document.createElement("script");
    rcs.src = " https://ringcentral.github.io/ringcentral-embeddable-voice/adapter.js?appKey=itC6A58EQYS0ae-w480bCg&...;
      var rcs0 = document.getElementsByTagName("script")[0];
    rcs0.parentNode.insertBefore(rcs, rcs0);
  })();
</script>

the error code I receive is:
oauth error:  Error: invalid_request
    at o (app.js:1)
    at t.<anonymous> (app.js:1)
    at r (app.js:1)
    at Generator._invoke (app.js:1)
    at Generator.e.(ringcentral.github.io/ringcentral-embeddable-voice/anonymous function) [as next] ( https://ringcentral.github.io/ringcentral-embeddable-voice/app.js:1:1191401)
    at r (app.js:1)
    at app.js:1
    at new Promise (<anonymous>)
    at new t (app.js:1)
    at t.<anonymous> (app.js:1)
(anonymous) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
e.(anonymous function) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
t @ app.js:1
(anonymous) @ app.js:1
e @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
e.(anonymous function) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
t @ app.js:1
(anonymous) @ app.js:1
e @ app.js:1
(anonymous) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
e.(anonymous function) @ app.js:1
r @ app.js:1
(anonymous) @ app.js:1
t @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
postMessage (async)
window.oAuthCallback @ proxy.js:1
(anonymous) @ ringcentral.github.io/ringcentral-embeddable-voice/redirect.js:1
topic-default
1 |1000 characters needed characters left characters exceeded

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

embbnux-ji avatar image
embbnux-ji answered ·
Hi, Nick. From the error message, it seems that you provide a valid 'appKey'. Would you please check the appKey in RingCentral Developer Website. I also try with your appKey.

Got following message from RingCentral API:

{
  "error" : "invalid_client",
  "error_description" : "Invalid client: itC6A58EQYS0ae-w480bCg",
  "errors" : [ {
    "errorCode" : "OAU-153",
    "message" : "Invalid client: itC6A58EQYS0ae-w480bCg",
    "parameters" : [ {
      "parameterName" : "client_id",
      "parameterValue" : "itC6A58EQYS0ae-w480bCg"
    } ]
  } ]
}

1 comment Share
1 |1000 characters needed characters left characters exceeded

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

Hi Embbnux,
I can confirm that the API Key is coorect. I have attached a snippet below...
0 Likes 0 · ·
embbnux-ji avatar image
embbnux-ji answered ·
If you just want to test the widget, you can remove configure params as following:

  (function() {
    var rcs = document.createElement("script");
    rcs.src = " https://ringcentral.github.io/ringcentral-embeddable-voice/adapter.js";
    var rcs0 = document.getElementsByTagName("script")[0];
    rcs0.parentNode.insertBefore(rcs, rcs0);
  })();

It will use default config params.
13 comments Share
1 |1000 characters needed characters left characters exceeded

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

Yeah, i tried that and received the same error!?
0 Likes 0 · ·
It's strange. I just test it with default params. It works for me. Can you go to this page to check if it works for you  https://ringcentral.github.io/ringcentral-embeddable-voice/

And can you provide more detail about how you use it. 
0 Likes 0 · ·
OK, following your link:
Click on "Sign In" in the RC popup.
Opens the RC Sign In popup ( https://service.ringcentral.com/login/unifiedLogin.html?session=-889812755084094010&responseType...)
n.b. this looks like the url for live rather than dev, is that correct?
Enter my credentials.
The Access Authorisation shows.
Click Authorise, and the popup disappears. I am left with the original RC popup with the "Sign In" button.

0 Likes 0 · ·
Additional:
I have also tried amending the params to just include the dev AppServer and this sent me to the correct Sign In page, but again, after I signed in using my sandbox credentials, and then Authorised the access, it left me with the Log In button and showed that oauth error in the console...
0 Likes 0 · ·
Oh, find the problem. Please create a new Public app with Carrier 'RingCentral'.  

1 Like 1 · ·
Show more comments
nick-buchanan avatar image
nick-buchanan answered ·
Hi


Share
1 |1000 characters needed characters left characters exceeded

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

Tyler Liu avatar image
Tyler Liu answered ·
Hi, I am having problem with implicit grant flow too. 

Nick, could you please inspect the network in Chrome devtools and post the network response here?

I want to confirm that we are talking about the same issue.
2 comments Share
1 |1000 characters needed characters left characters exceeded

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

The issue disappeared on my side.
0 Likes 0 · ·
Hi, Did you change anything at your end, or did it just begin to work?
0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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