Giter Site home page Giter Site logo

Comments (6)

julioct avatar julioct commented on May 12, 2024 1

Glad to help, but also TodoApi can become the blueprint for what I'm working on.

@davidfowl Any comments you can provide on this issue would be appreciated: dotnet/aspnetcore#52800

Just trying to make sure TodoApi is not outside of the ASP.NET Core Identity supported scenarios.

from todoapi.

julioct avatar julioct commented on May 12, 2024

@davidfowl I'm also interested in this. How would TodoApi evolve to switch the new Blazor app template with WASM interactivity (or even better, just SSR) and then use the new Identity endpoints in the backend API?

from todoapi.

davidfowl avatar davidfowl commented on May 12, 2024

https://github.com/davidfowl/TodoApi/tree/davidfowl/net8 still needs to update to RTM

from todoapi.

famda avatar famda commented on May 12, 2024

I've seen that branch, however the roles/claims is the actual part that I'm not confortable with.

I also opened an issue on the aspnetcore repo related to this (to see if someone helps on creating a sample on the docs or something).

What I've seen so far is that we need to create an additional endpoint on the api that takes the claims principal (logged user) and return a json representation of the roles/claims.

And, with this, have on the blazor project a authentication state provider that consumes that endpoint after the cookie creation to get the roles/claims.

This feels like a hack 😆 because the identity endpoints generates the token or cookie with that info inside.
This is the PR

In that example is a standalone WASM but this would be added on a "server" state provider to get the current authenticated user roles and then use the PersistentComponentState to share it to the the client (similar to the new template with identity).

Do you think this is the right approach?

from todoapi.

julioct avatar julioct commented on May 12, 2024

@davidfowl Thank you, this is awesome!

Here's a PR to update everything to .NET 8 RTM: #90

Verified it in my box, and all tests are passing.

from todoapi.

davidfowl avatar davidfowl commented on May 12, 2024

You are awesome!

from todoapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.