Server Side authentication
Hello, i have a bit problem using kinde
i probably just too dumb to understand how kinde work in general.
TLDR: how to check the user logged in using authrozation code flow using typescript SDK.
for the tech stack i am using deno fresh https://fresh.deno.dev . with typescript SDK
so based on this https://kinde.com/docs/developer-tools/typescript-sdk/ and https://kinde.com/docs/developer-tools/using-kinde-without-an-sdk/#supported-grant-types-for-getting-access-tokens . it is said that if the page is rendered by server, it is better to use Authorization Code Flow. and that is what i do here.
to make the server stateless. i am putting the session based on encrpted cookie.
however, based on https://kinde.com/docs/developer-tools/typescript-sdk/#check-if-user-is-authenticated.
client.isAuthenticated(sessionManager)
is only available on PKCE flow. so then, how can i know if the user is authenticated or not, as far as i know, after login()
is invoked, it tried to set ac-set-key
or acwpf-state-key
if using PKCE flow to the session. and isAuthenticated()
expect access_token
to available in the session. which is i think is not related at all.Kinde Docs
TypeScript SDK - Developer tools - Help center
Our developer tools provide everything you need to get started with Kinde.
Kinde Docs
Using Kinde without an SDK - Developer tools - Help center
Our developer tools provide everything you need to get started with Kinde.
5 Replies
Hi, The isAuthenticated is available on both the PKCE and authentication code flows. So this should work for you, are you having problems with it?
Have you checked https://github.com/kinde-starter-kits/deno-starter-kit. Pretty easy to change it to your specific needs. I am also using fresh.deno and got i working perfectly. Currently working on a better middleware option, but the package is a great starting point.
sorry but. that page does not exists on my side

Sorry, it is still in private by the Kinde team. Got early access to it to test it out.
Sended you a friend invite. I can send you the repo to clone 😉
good idea, already accepted your friend request.
after seeing the template i think i know why it is not working before.
the callback url should call this method
await kindeClient.handleRedirectToApp()
pardon for not reading the docs properly