As a junior, with every comment that you take in the video you are helping me understand what the code is all about thanks for this extremely helpful video.
Thank you for another extremely helpful video Patrick! I would love to see a video on .NET 8 Blazor Authentication & Authorization with Identity using Dapper instead of EF if possible.
Thanks for the video, it's giving me a jumpstart building my first Blazor app with .Net 8 and identity stuff. Slight changes to the project template now, but nothing I couldn't figure out. Cheers!
hi patrick...how i call api with token ?....we know your video the authentication and authorazation is base on cookies....what i mean is when using interactive auto how we send token after all .net assemblies are finished download....??
Excellent! Thank you so much! Tried it my side and it works well. One question, how can I get access to the current user's logged in details (more specifically the added properties?
I love how they made all the Identity razor components now, only thing missing is making this a PWA (progressive web application) so I can have one code base for the web & then submit to all the app stores, is it possible to add PWA? or would a different variety of template be needed?
Спасибо большое! По сути мне нравиться больше C# net core чем php и Laravel. У меня есть задачи по созданию школьной CRM, скорей всего я буду делать её на платформе net core.
There is something I would like to see you discuss that is how to make the login and registration pages use a specific layout, different from the default main layout. I managed to do that, but I would like to see someone implementing that too, to see if the way I did it is right or not.
Excellent video, thank you. It would be very helpful to indicate what needs to be done, when working on a project that originally does not have the identity management and you need to add it?
hi Patrick . nice video . but i cant login with base role in Blazor ssr webassembly with individual account . not accept role with this tutorial . i think it is differrence between 2 project server side and client . what can i do ?
Great video Patrick. Is in azure an Identity SAAS that we could customize like you did? The great question is, could I delegate the Identity management to azure and mind my on business? If it is possible, could you teach us?
I don't see any of the usual login controllers on the server side! How do you customize it? Also, I need to detect whether the user logged in via 2FA so I can limit access to most pages. How the bleep do I go this? I swear there's just NO information on this out there!
Hi Patrick, great video - however ....... could you do a video where the Login management is delegated to Okta or one of the other OpenId Connect providers, while still using the local Identity paradigm for role management, custom details, etc? That would be epic!
Please , Please do a video on how to get back the Windows Authentication the wonderful devs at Microsoft left out. Since the inception of ASP you have been able to select Windows authentication and have the Hello logged in user display. They just took the checkbox out and haven't given any working instructions on how to add it back. Some of use are still on IIS and need to be able to access the logged in user.
I'm looking for this too. I'd like to actually do windows authentication but use identity for the authorization and the roles. Ideally only an admin user can register new users.
4:43 Patrick, do you know why MS removed Authentication Type: Individual Accounts from final release .NET8? Add->New Scaffolded Item also doesn't have Identity position.
I'm using the Server Interactive type and I want to implement roles, but there is no Userinfo.cs file in the folder, any idea how to proceed? Edit: Already solved, all you need is to create the role in the DB as showed in the video, then skip directly to use it in your pages.
Hi Patrick, How do I go about using MainLayout for everything else except for Login and register page, how do I define that at rote level. When redirecting to login, how to tell the application not to use MainLayout view?
If you use interactive server mode on a razor page, UserManager is not supposed to be used on razor pages as it is not thread-safe. Looking at the UserAccesor coded you have there, wouldn't that cause dbcontext issues? How is it possible to get the customised IdentityUser on a razor page when you can't use UserManager? I have tried using the directive @inherits OwningComponentBase and then calling Service.GetUserAsync but that still throw context error randomly. I just can't work out how to get the IdentityUser safely on a razor page so I can access all their details not just their user name.
For those of us using VS Code instead of VS, is there a way to get Identity out of the box during 'dotnet new ..' or through a scaffolder using dotnet aspnet-codegenerator identity? The latter still creates the Razor pages identity UI not the blazor one.
Hello Patrick, thank you for the great content. I have a consern about the default architecture of a blazor project with identity. Is it safe or appropriate to access database directly from the frontend project without having an API layer in between?
Thanks for this useful video. I have a question. If we enable InteractiveServer mode in standart identity template then all Account pages (Login, Register, ...) refreshing in a loop and doesn't working as expected. I think it is a bug. Can you please give some ideas to solve it. Thanks.
Great video, very informative, Tank you! What if I have to use a custom user table coming from a legacy projects should I rewrite the whole authentication and create a custom one or is there a way to override just few classes?
great video as always! can you make a video of a Login page with a button loader while using this? im having problem with loader trying this. Thank you!
thanks .. i have problem how can i use google recaptcha with login and register form here because i cant use interactive server mode or webassembly here in register and login component or form
i have 2 projects and 1 library in my solution. I didn't implement authentication when i started it and im gonna retroactivly scaffold identityuser. my library is filled with my dtos where both my frontend and backend has a reference to. how would i implement all the identity functions into my blazor since i've done it retroactivly?
Thanks for the tutorial! I'm new to blazor and whenever i tried to update database, it's always throw an error said "Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')" How can i fix this error?
Thanks for video! How can I migrate the old aspnetcore.identity in existing blazor server project to new one blazor project with new authentication mode in .bet 8?
I´ve created a new Blazor Web App solution (maintaining all the namespaces etc the same) and copied all my pages to the new project. With some smaller adjustments it works, but the new identity pages are still very buggy. e.g. my application runs globally in server rendermode, but the identity pages are static and you get a null exception. Known bug which should be fixed with the next release, but for me, I will wait quite a few time until .NET 8 gets some fixes. In my opinion it´s not production ready.
Honestly, create new project based off the new template "Blazor Web App", add identity at that point and then migrate all your code accross.....then prepare for bugs! lol
Great video, thanks a lot 😎 Could be really interesting to make a video about how to deploy that app with SQL and Entity Framework Core on Azure though 🧐 I know for a fact it's not straight forward 😂
Hi (1st, sorry for my bad english level) Your tutorials are good, with enougth explanation. Just 2 things (you speak to fast to me) and It seems the solution pattern/template have changed since you created this tuto. v8.0.2
Hi very nice explaination. is it possible to add user with more roles like Admin and Manager, etc. is possible to show or hide component based on role. , please explain in detail and show us how to assign those roles after login.
You have to modify the mentioned files around 40:00 to handle multiple roles. Example: UserInfo.cs: public required IEnumerable Roles { get; set; } PersistingRevalidatingAuthenticationStateProvider.cs: var roles = principal.FindAll(options.ClaimsIdentity.RoleClaimType).Select(r => r.Value); PersistentAuthenticationStateProvider.cs: Claim[] claims = [ new Claim(ClaimTypes.NameIdentifier, userInfo.UserId), new Claim(ClaimTypes.Name, userInfo.Email), new Claim(ClaimTypes.Email, userInfo.Email)]; claims.AddRange(userInfo.Roles.Select(r => new Claim(ClaimTypes.Role, r))); If you wand to have users with hierarchic roles, consider using policies. Excellent article about this: chrissainty.com/securing-your-blazor-apps-configuring-policy-based-authorization-with-blazor/
Nice but what about API for security. Is it ok to work this way being they are Razor page, or is this a no-no and we should be doing API calls. What about Blazor MAUI in .net8?
First, thank you for this great tutorial. I had my solution running instant upon your guidance. For me, as a developer with the scope on business solutions... What do you think, how secure are the automated identity features?
Thanks so much for the positive feedback! I'm glad to hear the tutorial helped you get up and running quickly. Regarding your question about Identity, it's generally quite robust. It's built on industry-standard protocols and practices, ensuring a strong security foundation. However, the key to maximizing security lies in correct implementation and regular updates. It's crucial to stay updated with the latest security patches and to follow best practices for configuration. Hope this helps!
Nice , could you please make a detail video on configuring indexedDB in your blazor project and aslo authentication and autherization in indexedDb , Please do it if you can 💌
Hi patrick, have request can you please create video with permission to access blazor app on based of logged in user from windows and also get roles defined in active directory. would be grateful for that
Hello there, Thanks a lot for your content it is really helpful. I wanted to know if you have any full project using the new Blazor web app template and database first approach or if you plan to make a tutorial like this soon. Thanks for you help again.
Hello. Thanks for the great videos. I will appreciate it if you can give me direction as I am new in blazor. I have Blazore web app with Interactive Auto render mode and I have an external web api with api route to authenticate which returns a JWToken. My goal is to authenticate in Blazor using that token, and I'm stuck saving the user's logged data to storage.
Been enjoying your .net 8 videos. One thing I am frustrated by is being able to authenticate and authorise using Microsoft identity web. Simple Entra apl with some simple app roles like "Create, Update, Delete" etc. I can authenticate using Entra no problems, but razor pages fail to work using [Authorize] attribute it's not seeing me as authorised or the roles. This is blazor web app for dotnet 8, all server side no client. I just want Entra app to authenticate and authorise my users not the application, but completely stuck. Thanks for sharing this great content.
Hey Patrick! It would be really helpfull if you could make a Video about Identity and MySql Connetions with Pomelo? Ive tried and failed. I primarly use MySql Databases and want to integrate a Blazor Project into my existing Database Structure. Love your .Net Content! Thanks in Advance
Thank you very much for your videos, I am facing a problem :( .I need MainLayout to be interactive, it works correctly until I use the "Account" pages, it is because they need a HttpContext and lose interactivity (This is explained in AccountLayout). How can I keep the interactivity of MainLayout? Can you help me please?
@@bonaoenchelcha mmmm I Only use Blazor Webassembly (one project) with API for the Authentication with localStorage. NetCode-Hub videos helped me. Sorry for My English
Thanks for your videos. I'm new with blazor and am looking for some tutorials about how to authenticate blazor using bearer token using the new net 8 web identity api endpoints. I hope you can do some tutorials about that.
Declare your user class like this: public class ApplicationUser : IdentityUser { } Or replace the int32 type for any type you'd like to use. Of course you need to use a type that is compatible to a database type.
First of all, nicely explained. When I create a project with the new template (the Web App, not the Web App Blank) and run it after migrations, all I get is the 'Hello World' page. I never get rerouted to the login page. Anyone have an idea as to why?
Unfortunately, nothing what you provided works and I am stuck at 10:40 "A network-related or instance-specific error occurred while establishing a connection to SQL Server.". I dont even have the same file structure like you have in the Solution explorer. I did the same you did when creating this project. For example, I dont have the /Identity of nor the /Extension directories with their own files which are all displayed in your solution explorer. Would be nice if you plan beforehand what could potentially and two do those types of videos when Dotnet is not in a preview release. I want a hassle free tutorial because I am learning Blazor development and start from scratch when it comes to Authentication, Token and authorization. I dont want to waste my googling 8 hours around solving the issues I have right now. I will have to look elsewhere. I have nothing but problems with your other video ".NET 8 Authentication with Identity in a Web API with Bearer Tokens & Cookies". I run into issues and the video does not explain me anything.
If you don't want to spend 8 hours googling about a problem you can't solve then I recommend you give up on being a developer. This isn't a career where things work out of the box or solutions are spoon fed to you. Also, this is a free TH-cam video not a personal tutor. You get what you pay for.
UserAccessor in RTM is renamed IdentityUserAccessor and its method GetRequiredUserAsync wants a HttpContext as parameter. So how to use in a blazor server page where IHttpContextAccessor should not be used for Blazor apps?
Thank you for the video. Now it will actually work with an error. should be written not like this @attribute [Authorize(Roles ="Admin")] , but like this @attribute [Authorize] And then you just add the Roles and nothing extra.
They changed the template so it now looks different. Real shame for new people, its pretty hard to understand what is going on when everything is different. You video is very good though.
Thank you Patrick for demystifying .Net 8 user authentication & authorization. Something that until seeing your video seemed very baffling to me!
As a junior, with every comment that you take in the video you are helping me understand what the code is all about thanks for this extremely helpful video.
Rockin n' rollin !! Good stuff man!!
This an important video to check out for knowing Blazor. Thank you Patrick for this.
Thank you for another extremely helpful video Patrick! I would love to see a video on .NET 8 Blazor Authentication & Authorization with Identity using Dapper instead of EF if possible.
Yes, with Dapper or other database system. That would be great.
Another excellent video Patrick! Thank you for demystifying .Net 8 Authentication & Authorization!
Thank you very much for making this video - it helped me a lot!
Great stuff! Super helpful. Thanks a lot!
Thank you for the authorization part. I spent a long time trying to figure it out and this video really helped me. Thank you thank you.
Thank you, Patrick. Good job.
Thanks for the video, it's giving me a jumpstart building my first Blazor app with .Net 8 and identity stuff. Slight changes to the project template now, but nothing I couldn't figure out. Cheers!
Excellent ! Thank for showing us all this
Thank for making this. Can you make video on Authentication & Authorization without Identity (Basic Authentication)
Yes! please do one with Azure AD or Azure B2C.
I second this - I previously used Windows authentication for an intranet, but that doesn't seem to be supported as easily in .NET 8
Please continue the film with an http client and then pass the role to the api. Please help us
hi patrick...how i call api with token ?....we know your video the authentication and authorazation is base on cookies....what i mean is when using interactive auto how we send token after all .net assemblies are finished download....??
Thank you very much! This is very helpful and you explained it very well!
Thank God you exist, i can't understand shit from Indian's tutorials
It`s greate!!! Thank you very much!!!
Glad you like it!
Excellent! Thank you so much! Tried it my side and it works well. One question, how can I get access to the current user's logged in details (more specifically the added properties?
Thank you for this great content!
I love how they made all the Identity razor components now, only thing missing is making this a PWA (progressive web application) so I can have one code base for the web & then submit to all the app stores, is it possible to add PWA? or would a different variety of template be needed?
The WebAssembly Standalone app has PWA support
Спасибо большое! По сути мне нравиться больше C# net core чем php и Laravel. У меня есть задачи по созданию школьной CRM, скорей всего я буду делать её на платформе net core.
There is something I would like to see you discuss that is how to make the login and registration pages use a specific layout, different from the default main layout. I managed to do that, but I would like to see someone implementing that too, to see if the way I did it is right or not.
Excellent video, thank you.
It would be very helpful to indicate what needs to be done, when working on a project that originally does not have the identity management and you need to add it?
I was wanting a guide from scratch, like what is usually done in other tutorials 😕I hope we get one soon
hi Patrick . nice video . but i cant login with base role in Blazor ssr webassembly with individual account . not accept role with this tutorial . i think it is differrence between 2 project server side and client . what can i do ?
Great video Patrick.
Is in azure an Identity SAAS that we could customize like you did? The great question is, could I delegate the Identity management to azure and mind my on business? If it is possible, could you teach us?
I don't see any of the usual login controllers on the server side! How do you customize it? Also, I need to detect whether the user logged in via 2FA so I can limit access to most pages. How the bleep do I go this? I swear there's just NO information on this out there!
Hi Patrick, great video - however ....... could you do a video where the Login management is delegated to Okta or one of the other OpenId Connect providers, while still using the local Identity paradigm for role management, custom details, etc? That would be epic!
I am interested in AWS Cognito Self Hosted login pages with Blazor server/client
I also must use AWS Cognito (or our corporate idp which we currently federate to in Cognito) and am looking for examples.
Please , Please do a video on how to get back the Windows Authentication the wonderful devs at Microsoft left out. Since the inception of ASP you have been able to select Windows authentication and have the Hello logged in user display. They just took the checkbox out and haven't given any working instructions on how to add it back. Some of use are still on IIS and need to be able to access the logged in user.
I'm looking for this too. I'd like to actually do windows authentication but use identity for the authorization and the roles. Ideally only an admin user can register new users.
@patrick Sorry for late you missed the ; on line 67 🤣 Subscribed
Thank you so much! 😅
4:43 Patrick, do you know why MS removed Authentication Type: Individual Accounts from final release .NET8? Add->New Scaffolded Item also doesn't have Identity position.
I'm using the Server Interactive type and I want to implement roles, but there is no Userinfo.cs file in the folder, any idea how to proceed?
Edit: Already solved, all you need is to create the role in the DB as showed in the video, then skip directly to use it in your pages.
Good tutorial. Thanks!
It would be a great idea to create a video showcasing an application with multiple roles.
could you please add video about .NET 8 integrated windows authentication
Thanks Patrick, great info for early adopters. Just a question, do you have more info on cookies vs. tokens?
thanks. very educational
Glad it was helpful!
Hi, could you please create a tutorial on building a Blazor WebAssembly Standalone application with authentication via Azure AD B2C?
Hi Patrick, How do I go about using MainLayout for everything else except for Login and register page, how do I define that at rote level. When redirecting to login, how to tell the application not to use MainLayout view?
Really need one for blazor 8+ with 3rd party oidc that works in mixed mode.
The exact video I wanted awesome…
If you use interactive server mode on a razor page, UserManager is not supposed to be used on razor pages as it is not thread-safe. Looking at the UserAccesor coded you have there, wouldn't that cause dbcontext issues? How is it possible to get the customised IdentityUser on a razor page when you can't use UserManager? I have tried using the directive @inherits OwningComponentBase and then calling Service.GetUserAsync but that still throw context error randomly. I just can't work out how to get the IdentityUser safely on a razor page so I can access all their details not just their user name.
For those of us using VS Code instead of VS, is there a way to get Identity out of the box during 'dotnet new ..' or through a scaffolder using dotnet aspnet-codegenerator identity? The latter still creates the Razor pages identity UI not the blazor one.
Hello Patrick, thank you for the great content.
I have a consern about the default architecture of a blazor project with identity. Is it safe or appropriate to access database directly from the frontend project without having an API layer in between?
Very good! Do you have example code in git? I wanted to see the file 'PersistingRevalidatingAuthenticationStateProvider.cs'. Thanks.
Thanks for this useful video. I have a question. If we enable InteractiveServer mode in standart identity template then all Account pages (Login, Register, ...) refreshing in a loop and doesn't working as expected. I think it is a bug. Can you please give some ideas to solve it. Thanks.
Great video, very informative, Tank you! What if I have to use a custom user table coming from a legacy projects should I rewrite the whole authentication and create a custom one or is there a way to override just few classes?
Hi Patrick, great video thanks. Quick question. What if you are using multiple roles.. ? Will it work to just use List ? or List? Thanks..👍
great video as always! can you make a video of a Login page with a button loader while using this? im having problem with loader trying this. Thank you!
thanks ..
i have problem
how can i use google recaptcha with login and register form here
because i cant use interactive server mode or webassembly here in register and login component or form
Hey, can you help with generating the QR code for the 2fa and sending confirmation emails?
i have 2 projects and 1 library in my solution.
I didn't implement authentication when i started it and im gonna retroactivly scaffold identityuser.
my library is filled with my dtos where both my frontend and backend has a reference to.
how would i implement all the identity functions into my blazor since i've done it retroactivly?
Thanks for the tutorial! I'm new to blazor and whenever i tried to update database, it's always throw an error said
"Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')"
How can i fix this error?
Thanks for video!
How can I migrate the old aspnetcore.identity in existing blazor server project to new one blazor project with new authentication mode in .bet 8?
I'm having a lots of troubles with that.
I´ve created a new Blazor Web App solution (maintaining all the namespaces etc the same) and copied all my pages to the new project. With some smaller adjustments it works, but the new identity pages are still very buggy. e.g. my application runs globally in server rendermode, but the identity pages are static and you get a null exception. Known bug which should be fixed with the next release, but for me, I will wait quite a few time until .NET 8 gets some fixes. In my opinion it´s not production ready.
@@Fabius496 Exact the same senario and the same thoughts as mine.
I kept my blazor.server.js script and upgrade all the package references to .net 8 that works but not the new blazor unified (blazor.web.js)
Honestly, create new project based off the new template "Blazor Web App", add identity at that point and then migrate all your code accross.....then prepare for bugs! lol
Do you have any guidance on using CosmosDB as the EF Db Context?
Great video, thanks a lot 😎
Could be really interesting to make a video about how to deploy that app with SQL and Entity Framework Core on Azure though 🧐 I know for a fact it's not straight forward 😂
Another great video. Apply Migrations seems to work for me in the .net8 GA version.
Hi (1st, sorry for my bad english level)
Your tutorials are good, with enougth explanation.
Just 2 things (you speak to fast to me) and It seems the solution pattern/template have changed since you created this tuto. v8.0.2
Hi very nice explaination. is it possible to add user with more roles like Admin and Manager, etc. is possible to show or hide component based on role. , please explain in detail and show us how to assign those roles after login.
You have to modify the mentioned files around 40:00 to handle multiple roles. Example:
UserInfo.cs:
public required IEnumerable Roles { get; set; }
PersistingRevalidatingAuthenticationStateProvider.cs:
var roles = principal.FindAll(options.ClaimsIdentity.RoleClaimType).Select(r => r.Value);
PersistentAuthenticationStateProvider.cs:
Claim[] claims = [
new Claim(ClaimTypes.NameIdentifier, userInfo.UserId),
new Claim(ClaimTypes.Name, userInfo.Email),
new Claim(ClaimTypes.Email, userInfo.Email)];
claims.AddRange(userInfo.Roles.Select(r => new Claim(ClaimTypes.Role, r)));
If you wand to have users with hierarchic roles, consider using policies. Excellent article about this:
chrissainty.com/securing-your-blazor-apps-configuring-policy-based-authorization-with-blazor/
Nice but what about API for security. Is it ok to work this way being they are Razor page, or is this a no-no and we should be doing API calls. What about Blazor MAUI in .net8?
Can you explain how implement a gRPC with blazor if the gRPC is in the same .sln, Thanks!
Thank you
First, thank you for this great tutorial. I had my solution running instant upon your guidance. For me, as a developer with the scope on business solutions... What do you think, how secure are the automated identity features?
Thanks so much for the positive feedback! I'm glad to hear the tutorial helped you get up and running quickly. Regarding your question about Identity, it's generally quite robust. It's built on industry-standard protocols and practices, ensuring a strong security foundation. However, the key to maximizing security lies in correct implementation and regular updates. It's crucial to stay updated with the latest security patches and to follow best practices for configuration. Hope this helps!
Nice , could you please make a detail video on configuring indexedDB in your blazor project and aslo authentication and autherization in indexedDb , Please do it if you can 💌
Hi patrick, have request can you please create video with permission to access blazor app on based of logged in user from windows and also get roles defined in active directory. would be grateful for that
Susbcribed. Thank Patrick
hello patrick, could you make the same video but without identity? in net 8 custom authentication has errors, but not in net 7
Hello there, Thanks a lot for your content it is really helpful. I wanted to know if you have any full project using the new Blazor web app template and database first approach or if you plan to make a tutorial like this soon. Thanks for you help again.
Hello.
Thanks for the great videos.
I will appreciate it if you can give me direction as I am new in blazor.
I have Blazore web app with Interactive Auto render mode and I have an external web api with api route to authenticate which returns a JWToken.
My goal is to authenticate in Blazor using that token, and I'm stuck saving the user's logged data to storage.
Been enjoying your .net 8 videos. One thing I am frustrated by is being able to authenticate and authorise using Microsoft identity web. Simple Entra apl with some simple app roles like "Create, Update, Delete" etc. I can authenticate using Entra no problems, but razor pages fail to work using [Authorize] attribute it's not seeing me as authorised or the roles. This is blazor web app for dotnet 8, all server side no client. I just want Entra app to authenticate and authorise my users not the application, but completely stuck. Thanks for sharing this great content.
Hey Patrick! It would be really helpfull if you could make a Video about Identity and MySql Connetions with Pomelo? Ive tried and failed. I primarly use MySql Databases and want to integrate a Blazor Project into my existing Database Structure.
Love your .Net Content!
Thanks in Advance
Thanks for the videos. Can you do a video on .net 8 Blazor web app with Entra-ID?
I'm having an issue where all the account pages just keep reloading constantly. Any ideas?
how can we do this without Windows ? Eg MacOs + VSCode
also, is it possible to use something like azure cosmos or mongodb instead of sql ?
I can do something similar for a Maui app ?
Hi Patrick, need a critical help on my project regarding same type of integration, can you please help me out
Thank you very much for your videos, I am facing a problem :( .I need MainLayout to be interactive, it works correctly until I use the "Account" pages, it is because they need a HttpContext and lose interactivity (This is explained in AccountLayout). How can I keep the interactivity of MainLayout? Can you help me please?
Did you solve the problem ?
@@bonaoenchelcha mmmm I Only use Blazor Webassembly (one project) with API for the Authentication with localStorage. NetCode-Hub videos helped me. Sorry for My English
Thanks for your videos. I'm new with blazor and am looking for some tutorials about how to authenticate blazor using bearer token using the new net 8 web identity api endpoints. I hope you can do some tutorials about that.
Can this work with MongoDB?
Great video , can you show us how to extend the app to manage / edit users and assign roles . thanks great work .
Gracias.
Nice!
is is essential for me
Thank you Patrick, how can we change the id column of applicationuser to int PK instead of the guide type?
Declare your user class like this:
public class ApplicationUser : IdentityUser
{
}
Or replace the int32 type for any type you'd like to use.
Of course you need to use a type that is compatible to a database type.
First of all, nicely explained. When I create a project with the new template (the Web App, not the Web App Blank) and run it after migrations, all I get is the 'Hello World' page. I never get rerouted to the login page. Anyone have an idea as to why?
Unfortunately, nothing what you provided works and I am stuck at 10:40 "A network-related or instance-specific error occurred while establishing a connection to SQL Server.". I dont even have the same file structure like you have in the Solution explorer. I did the same you did when creating this project. For example, I dont have the /Identity of nor the /Extension directories with their own files which are all displayed in your solution explorer. Would be nice if you plan beforehand what could potentially and two do those types of videos when Dotnet is not in a preview release. I want a hassle free tutorial because I am learning Blazor development and start from scratch when it comes to Authentication, Token and authorization. I dont want to waste my googling 8 hours around solving the issues I have right now. I will have to look elsewhere. I have nothing but problems with your other video ".NET 8 Authentication with Identity in a Web API with Bearer Tokens & Cookies". I run into issues and the video does not explain me anything.
If you don't want to spend 8 hours googling about a problem you can't solve then I recommend you give up on being a developer. This isn't a career where things work out of the box or solutions are spoon fed to you.
Also, this is a free TH-cam video not a personal tutor. You get what you pay for.
No need to be a jackass@@calmhorizons
Does anyone have any idea why it 'auto-added' Tony Stark at approximately the 11:20 mark?
UserAccessor in RTM is renamed IdentityUserAccessor and its method GetRequiredUserAsync wants a HttpContext as parameter. So how to use in a blazor server page where IHttpContextAccessor should not be used for Blazor apps?
This:
[CascadingParameter]
private HttpContext HttpContext { get; set; } = default!;
It will be populated for you.
How can we implement Authentication using AD B2C in a .NET 8.0 Blazor Web App?
Why are there pages in both the client and in the backend
It is organised in such a way that the pages in the client are client-side rendered, the pages in the backend are server-side rendered
What happened to the other authentication types like "Windows"?
@Patrick God, is it possible to use Mongodb EF core?
Yes it is possible.
awesome
This new Identity Server in .net 8 is not production ready for me. Too buggy.
Thank you for the video. Now it will actually work with an error. should be written not like this
@attribute [Authorize(Roles ="Admin")]
, but like this
@attribute [Authorize]
And then you just add the Roles and nothing extra.
Tip: Role "ADMIN" and role "Admin" are two different roles.
Can please you make .net 8 asp net core hosted app with identity using JWTs, if you already have one could you reply with link please?
Please provide a repo
They changed the template so it now looks different. Real shame for new people, its pretty hard to understand what is going on when everything is different. You video is very good though.
I need the source code of this content 😔