question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authentication Error(checks.state argument is missing)

See original GitHub issue

SDK you’re using (please complete the following information):

  • Version 4.11.2

Describe the bug Getting following error after successfully authenticating with Xero

TypeError: checks.state argument is missing
    at Client.callback (/Users/bhrigusharma/Documents/work/web-backend/node_modules/openid-client/lib/client.js:398:13)
    at XeroClient.<anonymous> (/Users/bhrigusharma/Documents/work/web-backend/node_modules/xero-node/src/XeroClient.ts:118:48)
    at Generator.next (<anonymous>)
    at /Users/bhrigusharma/Documents/work/web-backend/node_modules/xero-node/dist/XeroClient.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/bhrigusharma/Documents/work/web-backend/node_modules/xero-node/dist/XeroClient.js:4:12)
    at XeroClient.apiCallback (/Users/bhrigusharma/Documents/work/web-backend/node_modules/xero-node/dist/XeroClient.js:77:16)
    at XeroNetworkService.<anonymous> (/Users/bhrigusharma/Documents/work/web-backend/src/modules/xero/xero.network.ts:30:53)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/bhrigusharma/Documents/work/web-backend/src/modules/xero/xero.network.ts:11:58)

apiCallback is throwing the error the above error

To Reproduce Steps to reproduce the behavior:

  1. Create an auth URL using buildConsentUrl
  2. Go to the above-generated URL and authenticate successfully
  3. Pass the URL which we get after redirection to apiCallback

url passed to apiCallback is like /finishAuth?code=<code>&scope=openid%20profile%20email%20accounting.reports.read%20accounting.settings&state=<state>&session_state=<session_state>

Expected behavior Should not throw an error instead should generate tokens

Additional context I upgraded my xero-node from 4.8.1 to 4.11.2 and my authentication flow stopped working Everthing was working fine on 4.8.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
adamreisnzcommented, Apr 20, 2021

This is yet another breaking change that is released as a minor version. Breaking changes should bump the major version of a package. Very frustrating.

0reactions
adamreisnzcommented, May 20, 2021

We would never under any circumstances use this code on the front-end, so that is a moot argument. But it’s alright, we will pass the parameter in the config of the client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BadRequestError: checks.state argument is missing
I am using express-openid-connect v1.0.1 and the new Universal Login page. Interestingly I never run into this when testing locally, only on the ......
Read more >
BadRequestError: checks.state argument is missing · Issue #145
BadRequestError: checks.state argument is missing would suggest that the transient state cookie is missing when your browser returns to the /callback url. When ......
Read more >
Debugging "checks.state argument is missing" error AUTH0
I am wondering if there are some configuration options that I may be missing in my login handler. import { handleAuth, handleLogin }...
Read more >
Checks.state argument is missing error - Console Login Issue
For the past week or so I have been unable to login to the console and have been receiving a message “checks. state...
Read more >
Errors - NextAuth.js - JS.ORG
This can occur during the handling of the callback if the code_verifier cookie was not found or an invalid state was returned from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found