Context user not being returned on auth callback.
I am using the the .Net SDK in a web api. Calling login is working fine and redirecting me to kinde but when I get redirected back the httpcontext is missing the User. All the tokens are returned, and the session cookie is created but the User is null which stops the Authorization working.
Any help here would be greatly appreciated.
14 Replies
Hey @Aidan,
Thanks for reaching out.
Would you be able to decide and inspect the claims of the ID token of the user after they have been authenticated? I want to know if there any claims of the ID token after the user has been authenticated.
That is from the client.User.IdToken.Claims
How did the user authenticate? Was it through email password or passwordless?
I have tried both. Same result for each
I see.
I will get a member of my team to investigate this issue and get back to you.
Hi @Oli - Kinde has there been any progress on this? It is holding us up moving to Kinde. Thanks Aidan
Hey @Aidan,
I am catching up with my team mate on the .NET SDK today,
I will get back to you tomorrow on an update.
Hey @Aidan,
We are currently in the process of updating our .NET SDK to strip away some of the auth logic in the SDK and utilise more of the built-in .NET auth logic that utilises OpenID Connect (OIDC).
My team believes your issue would be solved by utilising Kinde's OIDC solution rather then the .NET SDK.
I would suggest following the details in this doc.
Let me know if you come across any issues.
Also, I would love to pass by the .NET changes we make by you once we make the changes. Would you be open to trying the .NET SDK again once we have made changes mentioned above?
Ok I will try the OIDC solution today and get back to you.
Thanks @Aidan,
Let us know how you go
Sorry I forgot to mention I am using an Angular SPA front end with a .Net backend so quickly figured out the OIDC approach is probably not the fit.
HI @Aidan,
In that case, I would recommend having a read of the following doc: https://docs.kinde.com/build/applications/authenticating-spa/#_top
I would also suggest using either our JavaScript SDK or community-led Angular SDK
Let me know if you have any further questions.
GitHub
GitHub - luukhaijes/kinde-angular: Angular wrapper around the Kinde...
Angular wrapper around the Kinde Typescript SDK. Contribute to luukhaijes/kinde-angular development by creating an account on GitHub.
Kinde docs
Authenticating single-page apps (SPAs) with Kinde
Our developer tools provide everything you need to get started with Kinde.
I want to keep all the authentication on the API. Let me know when the updates to the .Net SDK have been done and I can give it a go.
Okay sounds good.
In the meantime, don't be afraid to follow the details in this doc that I previously shared.
The .NET changes are making will basically lead you to the same state as if you were following the doc.
Kinde on Notion
.NET ODIC Kinde integration tips | Notion
If you are using .NET with OpenID Connection (OIDC), we suggest the following.