ionic-team/legacy-ionic-cloud

Instagram Log in "message": "Invalid state parameter provided"

Closed this issue · 6 comments

Hello,

All was working great in testing, now I'm into production-level testing with quite a few users and experiencing severe problems. It only seems to occur on the first log in, so may be an Instagram API issue, but likely something with the callback?

I believe I was running 0.8.0 ionic-cloud, and will retry on the next production with 0.11.0 (@latest), however, I can't see that any auth has changed since?

In the code, I call:

  this.auth.login('instagram').then(()=>{
    this.navCtrl.push(HomePage);
    this.navCtrl.setRoot(HomePage);
  })

After the user has entered their credentials, an error shows up with:
{"meta": {"request_id": "c6735e79-d754-4032-c009-df07a2eb1106", "status": 400, "version": "2.0.0-beta.0"}, "error": {"type": "BadRequest", "link": null, "message": "Invalid state parameter provided"}}
in the In-app browser.

Ionic info:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v7.2.0
Xcode version: Xcode 8.2.1 Build version 8C1002

  "dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/compiler-cli": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/platform-server": "2.2.1",
    "@ionic/cloud-angular": "0.11.0",
    "@ionic/storage": "^1.1.7",
    "ionic-angular": "2.1.0",
    "ionic-native": "2.2.11",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.26"
  },

UPDATE: It seems to be when more than one user is logging in at the same time. Definitely needs attention..

Update: I have built a new project with "@ionic/cloud-angular": "0.16.0",, and replicated the issue showing that it is more than one user that causes the problem. Here's a video (apologies for focus, struggle to do one handed, haha).

https://youtu.be/SYUe04VBlU0

Would be awesome to get a fix soon or I'll have to think about setting up a server//other solutions.
Thanks :)

ericb commented

Hi @nicksmithr, thank you for bringing this to our attention, and apologies for the issues it may have caused you. I believe I've just put in a fix that should address this, can you confirm that you're able to login with multiple devices at the same time now?

Hi @ericb unfortunately it didn't. I tried with 2 iPhones and a Pixel at the same time, and only the Pixel logged in. I no longer get the same error message, but one iPhone is stuck re-loading, and another re-directs to the "Error" Instagram API log in page.

Oddly 2 iPhones at the same time worked; and when I log in on the iPhone a few hundreds ms before the Android. But not if Android logs in first? I'm unsure if OS has any inference here?

Update: Having some more success now, let me try 20 or so attempts and I'll let you know the feedback of each in the next post.

All seems good for now @ericb will let you know any problems I have with Beta testers. Thank you for the fix 👍

ericb commented

Great, glad to hear it. 👏