K
Kinde11mo ago
MiniKraken

KINDE_AUTH_WITH_PKCE on sveltekit throws error

Hi, When trying to authenticate you'll get redirected to the callback url. When the request hits the sveltekit server you'll find this error in the console:
error: {
"errorCode": "INVALID_TOKEN_MEMORY_COMMIT",
"name": "KindeSDKError",
"originalLine": 28,
"originalColumn": 28,
"stack":
KindeSDKError: Attempting to commit invalid access_token token "<redacted token>" to memory
at new KindeSDKError (/sdk/exceptions.js:24:14)
at <anonymous> (/sdk/utilities/token-utils.js:124:36)
at step (/sdk/utilities/token-utils.js:86:23)
at <anonymous> (/sdk/utilities/token-utils.js:25:71)
at new Promise (:1:11)
at __awaiter (/sdk/utilities/token-utils.js:7:34)
at <anonymous> (/sdk/utilities/token-utils.js:145:32)
at step (/sdk/utilities/token-utils.js:86:23)
at <anonymous> (/sdk/utilities/token-utils.js:25:71)
at new Promise (:1:11)
at __awaiter (/sdk/utilities/token-utils.js:7:34)
at <anonymous> (/sdk/oauth2-flows/AuthCodeAbstract.js:158:74)
at step (/sdk/oauth2-flows/AuthCodeAbstract.js:97:23)
at fulfilled (/sdk/oauth2-flows/AuthCodeAbstract.js:21:28)
at processTicksAndRejections (:12:39)
}
error: {
"errorCode": "INVALID_TOKEN_MEMORY_COMMIT",
"name": "KindeSDKError",
"originalLine": 28,
"originalColumn": 28,
"stack":
KindeSDKError: Attempting to commit invalid access_token token "<redacted token>" to memory
at new KindeSDKError (/sdk/exceptions.js:24:14)
at <anonymous> (/sdk/utilities/token-utils.js:124:36)
at step (/sdk/utilities/token-utils.js:86:23)
at <anonymous> (/sdk/utilities/token-utils.js:25:71)
at new Promise (:1:11)
at __awaiter (/sdk/utilities/token-utils.js:7:34)
at <anonymous> (/sdk/utilities/token-utils.js:145:32)
at step (/sdk/utilities/token-utils.js:86:23)
at <anonymous> (/sdk/utilities/token-utils.js:25:71)
at new Promise (:1:11)
at __awaiter (/sdk/utilities/token-utils.js:7:34)
at <anonymous> (/sdk/oauth2-flows/AuthCodeAbstract.js:158:74)
at step (/sdk/oauth2-flows/AuthCodeAbstract.js:97:23)
at fulfilled (/sdk/oauth2-flows/AuthCodeAbstract.js:21:28)
at processTicksAndRejections (:12:39)
}
7 Replies
onderay
onderay11mo ago
@MiniKraken thanks for raising this. Based on the error message provided, it appears that there is an issue with the access token being committed to memory within the SvelteKit server. The error INVALID_TOKEN_MEMORY_COMMIT suggests that the token being used is invalid or not in the correct format expected by the Kinde SDK. To resolve this issue, you should ensure that the access token being received from Kinde is valid and correctly formatted. This may involve checking the token generation and exchange process, ensuring that the correct client credentials are being used, and that the token has not expired or been tampered with. If you are using the SvelteKit SDK, you should also verify that the SDK is properly configured and that the environment variables are set correctly. Make sure that the KINDE_CLIENT_ID, KINDE_CLIENT_SECRET, and other related environment variables match the values provided by Kinde for your application. If after these checks you are still facing the error, let me know and I can an expert on the case
MiniKraken
MiniKrakenOP11mo ago
Thank you for your response. The thing is when i switch off PKCE it is working as expected. And also the error shows up on the callback path so I haven't modified the token in any way. The other env variables are correctly filled in. So I'm a bit at a loss here.
onderay
onderay11mo ago
Thanks for confirm @MiniKraken I am getting a team member to look into this.
MiniKraken
MiniKrakenOP10mo ago
Thanks. Appreciate it. any update on this ? @Andre @ Kinde
onderay
onderay10mo ago
Sorry in the delay, the team is trying replicate your issue. Are you able to provide us details regarding how you have PKCE configured on your end?
MiniKraken
MiniKrakenOP10mo ago
I'll try to create a Minimal Reproducable repo asap.
onderay
onderay10mo ago
Thanks
Want results from more Discord servers?
Add your server