Authenitication fails with PKCE=true on SvelteKit
Authentication in my SvelteKit app works fine if I leave PKCE disabled.
Once I set KINDE_AUTH_WITH_PKCE=true in the .env file, I get this error once the user logs in:
I have tried the following:
- removed client secret from .env file as described in the SvelteKit SDK docs
- added "authorization_code_flow_pkce" (also in combination with "code_challenge" and "code_challenge") to KINDE_SCOPE
- set up a new business in kinde and repeated this with the SvelteKit Starter Template
- recreated issue in local dev and deployed to live server
If I reload the page, I get "Error: Stored state not found at AuthCodeWithPKCE.<anonymous>" before I attempt to log in again.
What am I doing wrong?
Once I set KINDE_AUTH_WITH_PKCE=true in the .env file, I get this error once the user logs in:
Error: Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).
at AuthCodeWithPKCE.<anonymous> (file:///------/node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthCodeAbstract.js:289:31)
I have tried the following:
- removed client secret from .env file as described in the SvelteKit SDK docs
- added "authorization_code_flow_pkce" (also in combination with "code_challenge" and "code_challenge") to KINDE_SCOPE
- set up a new business in kinde and repeated this with the SvelteKit Starter Template
- recreated issue in local dev and deployed to live server
If I reload the page, I get "Error: Stored state not found at AuthCodeWithPKCE.<anonymous>" before I attempt to log in again.
What am I doing wrong?