2

I have problem about SigninManager. When I login in with tan.tastan@abcd.com, abdc.com is a reachable domain. But if I write a wrong domain, for example tan.tastan@abcd***E***.com, I am not getting a response and my application is waiting. Nothing happens and there is no return error code.

Here is my sample code, settings includes username, password, and domain information.

function doLogin(settings) {
    return new Promise((resolve, reject) => {
        window.skypeWebSDKApi.signInManager.signIn(settings).then((response) => {
            resolve(response);
        }, (error) => {
            reject(error);
        }).catch(reject);
    });
}

What is the problem?

Antti29
  • 2,953
  • 12
  • 34
  • 36
tntstn
  • 81
  • 1
  • 3
  • `what is the problem?` erm ... the domain doesn't exist would be a guess – Jaromanda X Oct 23 '17 at 08:29
  • by the way, your `doLogin` function is just `function doLogin(settings) { return window.skypeWebSDKApi.signInManager.signIn(settings); }` - if you take away the [promise constructor anti-pattern](https://stackoverflow.com/questions/23803743/what-is-the-explicit-promise-construction-antipattern-and-how-do-i-avoid-it) – Jaromanda X Oct 23 '17 at 08:33
  • As below, you can see full of my codes. I think, I did all changes what you said. But not working. by the way `settings` parameter has only `userName` and `password` – tntstn Nov 22 '17 at 05:58

2 Answers2

0

It's hard to know exactly what is going on without seeing the contents of settings but I suspect you're issue here is a promise not getting resolves. Try simplifying your call:

function doLogin(settings) {
    var app = new api.application;
    app.signInManager.signIn(settings).then(function () {
        console.log('success');
    }, function (error) {
       console.log(error);
    });
}
Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • actually domain name not exist (for example; the correct domain hotmail.com but the user writes hotmaiLL.com) and I am expecting a response with error code. but nothing happens. – tntstn Oct 26 '17 at 16:02
  • Did you resolve the promise issue? It would explain why you're not getting anything back when the use cancels the auth flow. – Marc LaFleur Oct 26 '17 at 16:42
  • I took away the promise. It did not work. And I refactored the code with alertsignInManager but it did not work too. the error is "Uncaught (in promise) TypeError: Cannot read property 'signIn' of undefined". So is it SDK Bug? – tntstn Nov 06 '17 at 07:39
  • My apologies, it looks like I fat fingered my snippet there. I've updated the example. The `signinManager` is part of the `application` so I believe the trouble here is that you first need to create the `app` before you can make the call. This would explain the `singIn of undefined`. – Marc LaFleur Nov 06 '17 at 14:24
  • As abow, you can see full of my codes. I think, I did all changes what you said. But not working. by the way `settings` parameter has only `userName` and `password` – tntstn Nov 22 '17 at 05:59
0

I've been using the SDK for quite a while now and this is my experience: When trying to log in using a non existing domain, the Web SDK never returns an error. I've tried different SDK versions and both General Availability and Public Preview API keys.

I ended up starting my own signin timer when trying to sign in. When no response is received within 20 seconds, I send a signOut request (which cancels the sign in) and show a message to the user (Please make sure you've entered the right username etc..). It's really lame to have a workaround like this but unfortunately I haven't found a better way yet to deal with this issue, also assuming Microsoft is not going to fix this anymore...

rile
  • 26
  • 4