I am only just starting using RingCentral and I am getting this error when attempting to login :
Access to fetch at 'https://platform.devtest.ringcentral.com//restapi/oauth/token' from origin 'http://localhost:51841' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I am using example code from github.com/ringcentral/ringcentral-js-client
<script type="text/javascript" src="~/Scripts/RingCentral/ringcentral.min.js"></script>
<script type="text/javascript">
var sdk = new RingCentral.SDK({
server: 'https://platform.devtest.ringcentral.com/',
clientId: '<clientid>',
clientSecret: '<clientsecret>'
});
sdk.platform().login({
"username": "<userid>",
"extension": "101",
"password": "<pwd>"
}).then(() => {
console.log("login success");
}).then((accountinfo) => {
console.log("current account info", accountinfo);
}).then(() => {
console.logout("logout success");
}).catch(e => {
console.error("Error", e);
});
</script>