Unable to authorize: invalid code verifier

GeertG1987GeertG1987 Member Posts: 3

Hi Support,

We are testing our integration with lightspeed, and I keep struggling to setup the authorization between strobbo and lightspeed for one of our customers:

 Customer details

ClientId: cG1EoAoAkwtRsTKxj1cFNTirXI7DeYxa

Executed steps to authorize:

  1. We generate the following authorization URL:

https://accounts.lightspeedapp.com/?client_id=cG1EoAoAkwtRsTKxj1cFNTirXI7DeYxa&response_type=code&response_mode=query&scope=openid+profile+email&redirect_uri=https://owr-public-services-dev.azurewebsites.net/api/webhook/lightspeed&prompt=&state=strobbo-t:DEV_BavetNL-c:1-w:1

 

  1. She authenticates, and grants access to strobbo what results in a redirect to our redirectURL: https://owr-public-services-dev.azurewebsites.net/api/webhook/lightspeed?state=strobbo-t:DEV_BavetNL-c:1-w:1&code={{code}}
  2. When the redirectURL is accessed, we execute a POST https://lightspeedapis.com/resto/oauth2/v1//token request with the given code
  3. grant_type=authorization_code&redirect_uri=https%3A%2F%2Fowr-public-services-dev.azurewebsites.net%2Fapi%2Fwebhook%2Flightspeed&code_verifier=S7HqB8pNOeaIg1qyx~LrGFrHgS8gVx5BVFb1NDXQqoixjjOXsrOz-YuL1Hf8gUUNM6tKHRUboEZgFXwxZ_oXNKBDz9FAjFrwohyJG.euLc3j14EqEvLQcz2bDEgmoyT0&code={{code}}

 

Unfortunately, this keeps returning the following error:

{"code":"bad_request","message":"Bad Request","statusCode":400,"details":[{"code":"code_verifier_invalid","field":"code_verifier","message":"invalid code verifier passed"}]}


When I try to authorize with our staging account, is works as a charm but unfortunately I don’t manage to get it working for our production customer. I am quite sure our code_verifier/challenge is correct since we use exactly the same as we do when we test with our staging account ([email protected])

Can you help us out please?

3 comments

Sign In or Register to comment.