K
Kinde4mo ago
Aidan

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
Oli - Kinde
Oli - Kinde4mo ago
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.
Aidan
AidanOP4mo ago
No description
Aidan
AidanOP4mo ago
That is from the client.User.IdToken.Claims
Oli - Kinde
Oli - Kinde4mo ago
How did the user authenticate? Was it through email password or passwordless?
Aidan
AidanOP4mo ago
I have tried both. Same result for each
Oli - Kinde
Oli - Kinde4mo ago
I see. I will get a member of my team to investigate this issue and get back to you.
Aidan
AidanOP4mo ago
Hi @Oli - Kinde has there been any progress on this? It is holding us up moving to Kinde. Thanks Aidan
Oli - Kinde
Oli - Kinde4mo ago
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?
Aidan
AidanOP4mo ago
Ok I will try the OIDC solution today and get back to you.
Oli - Kinde
Oli - Kinde4mo ago
Thanks @Aidan, Let us know how you go
Aidan
AidanOP4mo ago
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.
Oli - Kinde
Oli - Kinde4mo ago
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.
Kinde docs
JavaScript SDK
Our developer tools provide everything you need to get started with Kinde.
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.
Aidan
AidanOP4mo ago
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.
Oli - Kinde
Oli - Kinde4mo ago
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.
Want results from more Discord servers?
Add your server