question

Paul Thompson avatar image
Paul Thompson asked

Mismatched Redirect Uri

I'm trying to use the Ringcentral SDK with the Auth Code flow, I have setup my Oauth Redirect Uri in the app on the developer console under App -> my app name -> settings -> Oauth Redirect Uri

I was able to get an auth code setup using my app and the tutorial from https://github.com/ringcentral/ringcentral-api-docs/blob/master/docs/team-messaging/manual/node.md

But now that I am trying to add functionality that goes past what the ringcentral-chatbot package has by using the ringcentral SDK, I'm not able to use the auth code and redirect uri to login. here is some example code.


const SDK = require('ringcentral');
const rcsdk = new SDK({
    server: SDK.server.sandbox,
    appKey: myClientId,
    appSecret: myClientSecret,
    redirectUri: redirectUri
});
const platform = rcsdk.platform();
platform.login({
    code: myAuthCode,
    redirectUri: redirectUri
});


When I make the login request I get the following error "Redirect URIs do not match"

I have triple checked that the Redirect Uri in the Dev console -> App -> Settings -> Oauth Redirect Uri and my redirectUri variable in code are the same, and I have checked that the request being made through the SDK seems to have the correct body of

grant_type=authorization_code&code=<my_auth_code>&redirect_uri=<my_redirect_uri>

of course I have replaced the actual auth code with <my_auth_code> and redirect uri with <my_redirect_uri>

Is there any way I can figure out where the redirect uri mismatch is?

developer sandbox
1 |3000

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

0 Answers

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