Add Or Change Identity Claims In .Net 8 Blazor Web App #53902
Replies: 3 comments
-
Declare a static method for The example code like: public static string? GetFullName(this IIdentity identity)
=> (identity as ClaimIdentity)?.FindClaim("FullName")?.ToString(); and then you can get <AuthorizeView>
@Hello @context.User.Identity.GetFullName()
</AuthorizeView> |
Beta Was this translation helpful? Give feedback.
-
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
Beta Was this translation helpful? Give feedback.
-
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, In Create New Blazor Web App Project : Check => Individual
Check => .Net 8
Check => Auto Interactivew
and in ApplicationUser.cs I add a property for use full name
but in components i want show current user full name , but how to do it ? how to add custom claims to user and get in view component for example : i want in component use like this:
Beta Was this translation helpful? Give feedback.
All reactions