Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add roles and test user guidance #31839

Merged
merged 5 commits into from
Feb 15, 2024
Merged

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Feb 15, 2024

Fixes #31045

cc: @julioct ... My guesses on dealing with roles/role claims were good. The approach of NOT trying to fight the JSON serializer/deserializer to work with Claim arrays turns out to be the right way to go. Use of an anonymous type on the /roles endpoint side (backend server API) is fine, and using a custom RoleClaim type on the frontend is also good. These are the low-hanging-fruit happy paths 😄.

WRT other claim types, we're going to leave that to the devs to work out from this example. It's a straightforward update to this code to send all of the claims. The frontend code will take whatever is sent back and make user claims out of it. We might do more in this area down the road, but I need to get on with other work for now 🏃‍♂️😅. I'll take feedback from the community in the meantime.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/security/webassembly/standalone-with-identity.md Secure ASP.NET Core Blazor WebAssembly with ASP.NET Core Identity

@guardrex
Copy link
Collaborator Author

guardrex commented Feb 15, 2024

... and cc: @adrianjcalvert on this PR to see what's going in.

This will go live into the article by EOD. The sample app on the Blazor samples repo has already been updated ...

https://github.com/dotnet/blazor-samples/tree/main/8.0/BlazorWebAssemblyStandaloneWithIdentity

... BUT I forgot to update the README file. I'll do that in a few minutes. Done! 👍

... and also CC: to @famda-vestas on this.

... and @Ogglas.

I'm trying to notify everyone who asked.

@guardrex
Copy link
Collaborator Author

Ok ... cool ... glad to get this one in.

Thanks everyone! 🎉🍻

This will go ⚡ LIVE ⚡ in the article within a few hours.

@guardrex guardrex merged commit 2eca9c0 into main Feb 15, 2024
3 checks passed
@guardrex guardrex deleted the guardrex/blazor-wasm-identity-roles branch February 15, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Role claims guidance in standalone WASM w/Identity article
2 participants