Giter Site home page Giter Site logo

Comments (16)

guardrex avatar guardrex commented on June 15, 2024 1

Yep! I was right. That package reference shouldn't be there. It's provided by the shared framework. I'll re-open and remove it now.

Yes, you should be using it ... but NOT directly like this. I think Jeremy just made a slight mistake including it. It comes in via the shared framework. The app doesn't need a package reference for it.

from blazor-samples.

MrChriZ avatar MrChriZ commented on June 15, 2024 1

Fab thanks! :)

from blazor-samples.

guardrex avatar guardrex commented on June 15, 2024 1

That's what I had locally. Not sure why a delta existed between the repo and local app. VS these days makes namespace changes to files all by itself. I'll blame VS here for making my app correct! 😆

Thanks again for the issue. As you can see, we're still working a lot of 🪲 out of the docs and samples for 8.0. That process will continue for months.

from blazor-samples.

guardrex avatar guardrex commented on June 15, 2024

No, that's the latest version of that package. That one doesn't version with a number that matches the shared framework.

https://www.nuget.org/packages/Microsoft.AspNetCore.Identity

from blazor-samples.

MrChriZ avatar MrChriZ commented on June 15, 2024

Sorry I don't understand - the latest version is deprecated as per the link you've provided?

from blazor-samples.

guardrex avatar guardrex commented on June 15, 2024

It's a false warning ... one doesn't typically use the package directly like this. Normally, this is used by the metapackage. I think a remark about this in the article makes sense. I'll open an issue and address it next week. I'll ping u on the issue in a moment.

from blazor-samples.

guardrex avatar guardrex commented on June 15, 2024

... and I'll check further on this. I actually thought that if the shared framework has the package reference that it wouldn't need to be in the app's project file. I'll investigate and get back to you shortly.

from blazor-samples.

MrChriZ avatar MrChriZ commented on June 15, 2024

Thanks - It would be good to have some clarity. I've used it in a .NET 7 project already directly and I've seen posts across the web where people are unsure about what they should be using in place of Microsoft.AspNetCore.Identity - or if it is good to continue using it.

from blazor-samples.

guardrex avatar guardrex commented on June 15, 2024

Ok ... we're good now ... fixed on commit ...

9f7ea51

Thanks for opening this issue!

from blazor-samples.

MrChriZ avatar MrChriZ commented on June 15, 2024

Thanks - I think if you just remove the package you'll have the following error:
Error CS0246 The type or namespace name 'ClaimsPrincipal' could not be found (are you missing a using directive or an assembly reference?) Program.cs

potentially this can be resolved by referencing System.Security.Claims

from blazor-samples.

guardrex avatar guardrex commented on June 15, 2024

I didn't that error here. Where is that being thrown? ... which project? ... and is that for custom code. We won't cover anything beyond the base use case; however, this sample will be expanded later to include a role claims endpoint in the backend so that the frontend can implement user roles.

from blazor-samples.

MrChriZ avatar MrChriZ commented on June 15, 2024

That's simply downloading your repository. No code changed. (I pulled the project into a VS solution but that's it).
After referencing the System.Security.Claims in Program.cs the project compiles fine

from blazor-samples.

MrChriZ avatar MrChriZ commented on June 15, 2024

And sorry it's in the 8.0 Backend project as per my original screenshot.

from blazor-samples.

guardrex avatar guardrex commented on June 15, 2024

Ah! I see it had the MVC package there for it. I changed it to your suggestion of System.Security.Claims on ...

#135

https://github.com/dotnet/blazor-samples/blob/main/8.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Program.cs#L1

from blazor-samples.

MrChriZ avatar MrChriZ commented on June 15, 2024

This is all good news as far as I'm concerned. Back in April I was working on a project to implement something like what you now have built in and much hair was lost figuring it out! 😆
What I've seen so far looks great! :)

from blazor-samples.

guardrex avatar guardrex commented on June 15, 2024

I agree. We needed this for years ... and was asked for it quite a bit. We do need the roles piece for sure. However ... even in this form ... it shoudn't be too difficult for folks to roll their own controller into the backend and send back role claims for use by the frontend.

We're going to leave the extra coverage on the other scenarios/endpoints (e.g., 2FA) over in the main doc set. That coverage is being worked on now at ...

dotnet/AspNetCore.Docs#31197

What I don't know is if they'll relent and provide a fully working implementation for token auth. Right now, they just guide toward it with notes and a partial implementation. I'm telling them on ...

dotnet/AspNetCore.Docs#31214

... that I think it should be fully worked out and presented.

from blazor-samples.

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.