ally icon indicating copy to clipboard operation
ally copied to clipboard

Exception: E_OAUTH_STATE_MISMATCH (Ally 2.1.0)

Open vincentducorps opened this issue 8 years ago • 8 comments

Package version

"version": "4.1.0", "adonis-version": "4.1.0",

@adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected] @adonisjs/[email protected]

Node.js and npm version

NodeJS v10.9.0 npm 6.2.0

Sample Code (to reproduce the issue)

I have this exception when I try to access to Google API since I upgraded Ally to version 2.1.0. This code works on the previous version (2.0.5)

OAuthException
E_OAUTH_STATE_MISMATCH: Oauth state mis-match

start/routes

  Route.get('auth/google', async ({ ally }) => {
    await ally.driver('google').redirect()
  })

  Route.get('authenticated/google', async ({ ally }) => {
    const user = await ally.driver('google').getUser()

    return user
  })

vincentducorps avatar Oct 01 '18 13:10 vincentducorps

Should be good with v2.1.1

thetutlage avatar Oct 02 '18 12:10 thetutlage

Thank you!

vincentducorps avatar Oct 02 '18 12:10 vincentducorps

happened to me too on v2.1.3

radiegtya avatar Jun 18 '19 07:06 radiegtya

@radiegtya, I fixed it by downgrading to v2.1.1 from v2.1.3. @thetutlage, this issue should get opened again or a new one should be created. Preferably a new one for v2.1.3.

iamramo avatar Jan 07 '20 12:01 iamramo

I opened new issue related to this. #96

muhx avatar Jan 27 '20 10:01 muhx

not working v2.1.3

rickafds avatar Feb 01 '20 22:02 rickafds

Also confirming issues with v2.1.3.

I have had some success with it, but it fails when it shouldn't. I haven't determined why it has spotty success.

Edit: After re-installing 2.1.3, it seemed to work for me. Not sure what the cause was.

mattkenefick avatar Mar 04 '21 02:03 mattkenefick

@mattkenefick Can you open a separate issue and share more information to debug the issue. The common cause for E_OAUTH_STATE_MISMATCH is having sameSite cookies enabled. Once you disable them, it should work fine

thetutlage avatar Mar 04 '21 06:03 thetutlage