version: 1.18.0
In IE edge the authenticateUser method nearly crashes the browser. It is very slow. Once authenticated the browser still hangs and click events seems to be disabled. Sometimes is recovers, sometimes is does not. When removing the cognito authentication and hardcoding the token everything works fine.
looking for a response here - this performance makes Cognito unusable on any version of internet explorer or IE edge
What exactly is the behavior you are seeing? Does authentication fail or is it really slow? I'm not exactly sure why the browser would hang once authenticated, all the library does is retrieve tokens once authenticated and the tokens are used for other calls to retrieve attributes, update settings etc so it shouldn't affect your application in any way anymore. I have tested on Internet Explorer 11 and authentication is almost instantaneous. Can you try the version of the SDK I linked in https://github.com/aws/amazon-cognito-identity-js/issues/411 and mention if you notice any improvements?
I've mentioned this problem in Hawatel/aws-cognito-ionic-demo#1 but I confirmed that bnModPow was taking lots and lots of time. Authentication does succeed sometimes and other times it timeouts(?). After authentication success, there are no critical performance issues.
But at the time I was using 1.17.0 so I'll give 1.18.0 a try and see if there are any difference.
I meant to try the dist.zip in the issue I linked not 1.18.0
@itrestian Sorry for the misunderstanding and thanks for your support. I've confirmed that the version you mentioned in #411 dramatically improves the performance. Tested it on IE11 and Edge and they both work great. Looking forward to see this being released. I'd like to apply it to my productions.
Done.
@itrestian can we open this ticket back up. The new package that you mentioned took 24 seconds in IE Edge, an improvement of the last version, but still I wouldn't say an acceptable amount of time. The browser hangs and doesn't respond until it is complete.
@realseanp
kfukuyama above said that Edge worked great for him. I tested it myself without any problems. Is there anything specific about the environment you are testing in, an older device, certain browser settings that you have set?
In general, the slowness of authenticateUser comes from the modpow operation combined with an older computer and certain browsers (javascript engine being the differentiator). Basically going slower computer, older browser will slow down modpow a bit. See screenshot in issue: https://github.com/aws/amazon-cognito-identity-js/issues/404
Most other computations are really fast for SRP, however the modpow operation is so to speak the main part of SRP (raising to a power and getting modulus of big integers). modpow in our case is performed using the JSBN library which uses montgomery modular multiplication http://www-cs-students.stanford.edu/~tjw/jsbn/jsbn.js
In our case, the size of the integers is fixed by the service so for the integers our service deals with (recommended by security), montgomery multiplication is the best way to go (other methods won't perform as fast).
Just for additional information, I'm using a Surface 3 (non pro) and previously it took almost a minute for response and sometimes it even crashed the browser but with this fixed version, it's taking only few seconds.
I'm using it in an Angular App (but I assume this doesn't matter much).
I haven't heavily tested it yet but it seems it's working pretty well. I'll add some information if I notice something.
@realseanp to follow-up. what is the platform you are running on? also what is the network connection you are testing on? mobile, wi-fi, wired? what Cognito endpoint are you hitting and from where? Do you have device tracking enabled for your user pool. Any other info such as request Ids or any profiling information would be much appreciated.
@itrestian We are testing IE Edge on the fastest machine we have. 150mbps wifi
Testing IE Edge on machine with the following stats took 27 seconds to complete. The browser tab showed the Not Responding message during that time.
core i74-6700hq CPU @ 2.60GHz
64GB of RAM
500 GB SSD
All we are doing is creating a cognito user and then calling authenticateUser and caching the tokens. Here is the code we use:
function signIn(
username,
password,
) {
var u = new CognitoUser({
Username: username,
Pool: new CognitoUserPool({
UserPoolId: userPoolId,
ClientId: clientId,
}),
});
return new Promise((resolve, reject) => {
u.authenticateUser(
new AuthenticationDetails({
Username: username,
Password: password,
}),
{
onSuccess: auth => {
u.cacheTokens();
resolve({
success: true,
user: u,
token: auth.getAccessToken().getJwtToken(),
});
},
onFailure: reject,
},
);
});
}
Any updates on this issue?
We have tested the code provided in similar environments (IE Edge and versions of IE on 2.6 Ghz I5) and the code takes 2-3 seconds to complete authentication so we couldn't reproduce 20+ seconds of delay.
As I mentioned before, it would be good to provide more profiling information similar to https://github.com/aws/amazon-cognito-identity-js/issues/404 to pinpoint exactly where the slowdown comes for you guys.
There are also some other options: since it seems you have device tracking enabled, that's another full round of authentication using the device info which would cause further delay. Disabling this should speed up authentication. If some of the slowdown comes from the old version of the aws-sdk (aws-cognito-sdk) we are using, we could try to upgrade that.
Most helpful comment
looking for a response here - this performance makes Cognito unusable on any version of internet explorer or IE edge