amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
423 stars 232 forks source link

Connection reset error #169

Open kelp404 opened 5 years ago

kelp404 commented 5 years ago

Hello,

I have the same issue like this:

I have setup Cognito using OpenID with Salesforce as the Identity Provider. I am able to login fine with the redirect giving me an authorization_code in the url. However if I open a new Chrome window in Incognito mode and try to login again I intermittently get redirected with an error in the url as follows: https:///login?error_description=Connection%20reset&error=invalid_request Any ideas on why I am getting this error?

https://stackoverflow.com/questions/51640439/cognito-with-salesforce-error-when-logging-in

Some time it is work:

2018-12-05 12 48 07

Some time it is not work:

2018-12-05 11 25 05
niklug commented 5 years ago

I have the same issue, it works not stable.

pendo324 commented 5 years ago

I'm having the same issue, also with Salesforce OpenID provider. It fails the first time with "Connection reset". I'm using Amplify, though.

teesmatt commented 5 years ago

I also have the same issue with amplify

dspasojevic commented 5 years ago

Was there a resolution to this issue? We are seeing similar errors with a third-party's (not SalesForce) IdP.

kelp404 commented 5 years ago

I removed amazon-cognito-auth-js. I direct do oauth by myself.

niklug commented 5 years ago

As this issue looks like won't be fixed in near future, I solved that flow with catching that error and retry sign it on it (for Amplify):

onHubCapsule(capsule: any) {
    const { channel, payload } = capsule;
    if (channel === 'auth' && payload.event === 'signIn') {
      this.props.history.push(RoutePath.HOME);
      this.props.getUserSession();
      // handle Exception processing authorization error  with retry
    } else if (
      channel === 'auth' &&
      payload.event === 'signIn_failure' &&
      payload.data === 'Exception+processing+authorization+code'
    ) {
      AuthService.loginSalesforce();
    }
  }