Replies: 1 comment
-
After reading these blog posts, I don't see much value in IdentityEndpoints in their current implementation. https://andrewlock.net/exploring-the-dotnet-8-preview-introducing-the-identity-api-endpoints/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Blazor Server app that signs in users using
AspNetCore.Identity
(in.NET 8 RC2
) using cookie authentication and need to call a protected API.I'm currently calling the protected API using Api Key Authentication.
This is the full source code (it's a very simple implementation for a demo):
https://github.com/affableashish/blazor-identity-api
(Is my architecture good? Please give suggestions if there are ways I can improve it.)
My questions:
Can Identity Endpoints introduced in .NET 8 help me replace that Api Key Authentication with Token (Bearer) authentication?
If yes, how would I do that?
Like removing
AspNetCore.Identity
from my Blazor Server client app, create a new API that hosts Identity endpoints, call that Identity endpoints API to get token, claims, roles etc. of a user during login and use that to log in my users using cookie authentication from the Blazor Server client app, use the token I got from my previous call to call the protected API?The biggest difficulty I see with this (if it's even possible) is calling Identity endpoints and signing in the users in the Blazor Server client app. At this point I'd be redoing the effort that I can simply get out of the box if I use
AspNetCore.Identity
scaffolded into this Blazor Server client app, so I'm not sure if it's even worth it.If No, should I keep using Api Key authentication for calling my secured API?
What are the practical use cases of Identity endpoints? Please provide an example.
Beta Was this translation helpful? Give feedback.
All reactions