furaiev / amazon-cognito-identity-dart-2

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
187 stars 114 forks source link

[web] [Internet explorer] authenticate error: Unsupported operation: No source of cryptographically secure random numbers available #70

Closed ductranit closed 3 years ago

ductranit commented 4 years ago

I used the following code to authenticate user:

 final authDetails = AuthenticationDetails(
        username: email,
        authParameters: List(),
        validationData: {},
        password: password);
    try {
      _session = await _cognitoUser.authenticateUser(authDetails);
    } on CognitoUserCustomChallengeException catch (e) {
      // handle custom challenage
      print('custom challenage $e');
    }  on Error catch (e) {
      print('Error $e');
    }

And then I get the error on IE 11.

Unsupported operation: No source of cryptographically secure random numbers available

It works fine on FireFox, Chrome, Edge. Do you have any suggestion to fix this issue? Could it relate to Crypto package?

furaiev commented 4 years ago

@ductranit is this the full error text? Did you get more details?

ductranit commented 4 years ago

hi @furaiev This is the full stacktrace. Notice that I'm not able to run debug on IE, this log is coming from the flutter build web and python -m http.server to run on localhost

HTML1300: Navigation occurred.
web
start from http://localhost:8000/build/web/#/
Unsupported operation: No source of cryptographically secure random numbers available.
   at P.aDk.prototype.a0V (http://localhost:8000/build/web/main.dart.js?version=10:39397:1)
   at P.b4A (http://localhost:8000/build/web/main.dart.js?version=10:6389:1)
   at D.aLW (http://localhost:8000/build/web/main.dart.js?version=10:17122:13)
   at N.a5F (http://localhost:8000/build/web/main.dart.js?version=10:9583:1)
   at Anonymous function (http://localhost:8000/build/web/main.dart.js?version=10:40516:1)
   at Anonymous function (http://localhost:8000/build/web/main.dart.js?version=10:3794:71)
   at P.aIR.prototype.$2 (http://localhost:8000/build/web/main.dart.js?version=10:33745:18)
   at P.o (http://localhost:8000/build/web/main.dart.js?version=10:3780:17)
   at V.M9.prototype.a1C (http://localhost:8000/build/web/main.dart.js?version=10:40527:1)
   at V.M9.prototype.wz (http://localhost:8000/build/web/main.dart.js?version=10:40509:16)
SCRIPT16389: 
zone.dart (1175,21)
furaiev commented 4 years ago

@ductranit unfortunately, I work on mac and can't check it on IE. Please try to debug it.