Welcome to the Kinde community.

P
K
A
A
A

SvelteKit KINDE_REDIRECT_URL

Hi all,

Just started trying to swap over to Kinde, having followed the "SvelteKit SDK" page in the docs and am seeing
Plain Text
Invalid KINDE_REDIRECT_URL: Invalid URL
code: 'ERR_INVALID_URL',
input: 'undefined/oauth2/auth'

I'm pretty sure my configuration/env just flat-out isn't recognised 😦

I've more or less copied things 1 for 1, and double checked all variables configured in my .env, and within the Kinde dashboard.
There's no extra spaces, no missing slashes in the protocol, nada.

Two aside notes...
  1. I use a PUBLIC_ prefix for my variables and I can't see a way to make that compatible with Kinde (Yes, I have experimented with and without this before raising this thread)
  2. Step 1 in the docs say "In Kinde, go to Settings > Applications and then navigate to the relevant frontend app or backend app.", but I couldn't find the secret key for the frontend app, which is needed for the "Configure your app" step. I'm also not entirely sure which is applicable for sveltekit. Either way - I have tried both the front and back-end apps for configuration Kinde and had no luck.
g
S
O
17 comments
I think I've answered aside-note #2. The front-end app in Kinde doesn't have "SvelteKit" under it's quickstart - only "Svelte".

So - I guess backend is the way to go.

Having to use a secret is even more reason to have support for aside-note #1: private/public prefix support (or just some way of mapping whatever env keys I want into kinde's sdk)
doesn’t look like you set your redirect url properly
just from the error alone, I can see that the path got screwed up, but i’m not too familiar with svelte/kit (should be fine with either) to give you definite fix
Hey @grump,
Currently we only have an SDK for SvelteKit, not Svelte.
However, you can still integrate with Kinde with Svelte using our JavaScript or TypeScript SDKs, or following our Using Kinde without an SDK guide.

@grump - Are you wanting to implement Kinde with pure Svelte or SvelteKit
Hey @Oli - Kinde - I'm using sveltekit
Thanks for confirming @grump,
Would you be be willing to send over a code snippet that reproduces your issue, so my team can reproduce and investigate your issue?
Like a reproduction repo? I imagine the issue is somewhere in my configuration and if I were to spin up a reproduction it likely wouldn't happen again.

But, I can't see anything out of the ordinary either. I'll give it a shot.
Hey @grump,
Are you able to try the SvelteKit starter kit and let me know if you are still experiencing issues?
Hey @Oli - Kinde I haven't delved into the issue much just yet, but off the bat, after inserting my own environment variables to .env and I get...
Plain Text
{
    "error": "invalid_request",
    "error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Requested audience 'https://your_kinde_domain.kinde.com/api' has not been whitelisted by the OAuth 2.0 Client."
}
wait - yup, didn't replace the domain in the audience param
And sure enough - same "invalid_request" error as above, but it just includes my kinde url in the error, and not your_kinde_domain...
I'll also note that this is using a kinde env I created shortly after opening my account.
The default was production, so I made a dev env. edit: I just tried using the prod environment that existed when I created my kinde account and no luck there either
.
The debug page at /api/auth/health is showing all the variables (which is not the case when using my own project)
@Oli - Kinde happy to DM you any details like client ID or domain name if that helps
Hey @grump,
Did you experience the above using the SvelteKit starter kit?
@Oli - Kinde - Yup
Cloned repo, pasted in my env vars from my app's quick start page, yarn, yarn dev, click login or signup, get that error
Hey @grump,
Sorry to hear you are still experiencing issues.
Are you able to send over a recording of your experience? You can send it to my team privately via the #🤫┃confidential-support channel.
Add a reply
Sign up and join the conversation on Discord
Join