Hi everyone,
I am testing the webapp on localhost, I have set the basic authentication code with javascript SDK that was working fine until now.
The error is OAU-234:The client is not available for account returned from , which I haven't found in the RingCentral documentation
RingCentral.SDK.handleAuthRedirect();
my code:
var rcsdk = new RingCentral.SDK({
server: RingCentral.SDK.server.sandbox,
// server: RingCentral.SDK.server.production,
appKey: 'myAppKey',
appSecret: 'myAppSecret'
});
//Get the Platform object
var platform = rcsdk.platform();
function authorize() {
platform.authWindow({
url: platform.authUrl()
})
.then(function(options) {
options.redirectUri = 'http://localhost/ring/';
console.log(JSON.parse(localStorage.getItem("rc-platform")));
return platform.login(options);
})
.then(function(res) {
alert('Login successful
' + JSON.stringify(res.json(), null, 2));
})
.catch(function(e) {
alert('Auth error
' + e.message);
})
}
if(!rcsdk.platform().auth().accessTokenValid()){
authorize();
RingCentral.SDK.handleAuthRedirect();
}
thank you for all the help that you could give.