oidc-client icon indicating copy to clipboard operation
oidc-client copied to clipboard

state not valid (expected: kA6pgvCtBpauwMl0, received: myState)

Open hmz22 opened this issue 1 year ago • 3 comments

Issue and Steps to Reproduce

when Redirect to auth server after sucess login and redirect back to client callback url dotn call token and show error in console state not valid. i create auth server with @node-oauth/oauth2-server this my config:

configuration={
        authority: "http://localhost:7003",
        client_id: "myClient",
        redirect_uri: "http://localhost:5173/cb",
        scope: "profile",
        authority_configuration: {
          authorization_endpoint: "http://localhost:7003/oauth",
          token_endpoint: "http://localhost:7003/oauth/token",
          issuer: "http://localhost:7003",
          revocation_endpoint: "http://localhost:7003/revocation",
        },
        token_request_extras: {
          client_secret: "test_secret",
        },
        storage: localStorage,
      }

if see second screenshot after redirect to callback, you don't see any token call

Versions

7.13.7-alpha.1239

Screenshots

Screenshot 2023-12-13 110346

Screenshot 2023-12-13 110522

hmz22 avatar Dec 13 '23 07:12 hmz22

Hi @hmz22 , thank you for your issue. It seem your server send back in the mySate information inside the callback url.

You can send extra parameter to the login function like {state:"myState"} it should (not sure) work if your oidc server always send myState back.

guillaume-chervet avatar Dec 13 '23 20:12 guillaume-chervet

Hi @hmz22 did it solve your issue?

guillaume-chervet avatar Dec 19 '23 06:12 guillaume-chervet

Hi @hmz22 did you solve your issue ?

guillaume-chervet avatar Feb 04 '24 09:02 guillaume-chervet