I have issue which i want to save the branchcode on every login i tried localstorage it say prerender is enabled that issue is there a way in identity or something which can make this possible before i used jwt token and saving the branchcode in token but now in this i don't have any idea any help
Is it safe to use userManager in Blazor components? I know that login has to be done using Razor Page because of httpContext which is not safe to use inside components, but If I want to do some user administration (add another user, list users, ....) or even change current user password, is it safe to do that in Blazor Server components or it must be done using Razor Pages?
From my point of view it's not an ideal option, but it would be something you could live with if you know the caveats. The main problem here is that components might be long lived and there is no way to make sure that you create UserManager instances only when you need them and dispose them immediatiely afterwards. That's what IDbContextFactory makes possible. This being said, using the UserManager or other identity services in Blazor Server components might cause you the following issues: 1. Concurrency issues 2. "Entity already tracked" exceptions 3. Other more imprevisible issues If you are ware of this and you think you can implement safeguard conditions to recover from such exceptions, then you can use it. Without these safeguards you will get a lot of exceptions.
Depends on collation settings CS = Case Sensitive CI= Case Insensitive you need to have one or the other. AS = Accent sensitive, AI = Accent Insensitive.
I’m looking for how to tell Blazor where folders are, like the Areas/Identity etc. I’m pretty sure you showed that in one of your videos but I cannot find it. It’s probably where you added the Login links. Can you point me to the correct video?
If you have Windows Authentication and want to use Claims instead of Roles/Group Membership, how would you add Claims to the User and use those claims for authorization?
If you have Windows Authentication set up in your project then you can achieve this by simply adding a polici with RequireRole("Daomain\\Group") and it should work. It would be something like: builder.Services.AddAuthorization(options => options.AddPolicy("MyRolOnly"), policy => policy.RequireRole("Domain\\Group")). That's how ASP.NET Core works in general. It is not related to Blazor in any way.
what about for example, when you need to authorize user to allow edit a product or not, what kind of logic we can apply ? BTW This is a Really nice content
The Authorize component is used like the Authorize attribute in regular APIs. It means you can define custom policies and authorize each component by policy.
I am searching last one year for the topic 'Claims based authorization in Blazor Webassembly' but can't able to find out. Please provide tutorial for 'Claims based authorization in Blazor Webassembly and ASP.net MVC core Web API using JWT'. I am particularly asking for CREATE, DELETE and PRINT actions in a module. Actions buttons are provide corresponding to user. Please...
Thank you for your clear and detailed explanation.
You can use the shortcut for formatting the code
Ctrl+k, Ctrl+D
Thanks for the tip!
I use that one all the time!
beautiful explained. many thanks
Thank you. This is one of the most underperforming of my videos and I'm glad that you found it and you think it was useful.
I have issue which i want to save the branchcode on every login i tried localstorage it say prerender is enabled that issue is there a way in identity or something which can make this possible before i used jwt token and saving the branchcode in token but now in this i don't have any idea any help
How about security of this kind of authentication/authorization? A lot of developers suggests better way is to use external tools like Firebase
Is it safe to use userManager in Blazor components? I know that login has to be done using Razor Page because of httpContext which is not safe to use inside components, but If I want to do some user administration (add another user, list users, ....) or even change current user password, is it safe to do that in Blazor Server components or it must be done using Razor Pages?
From my point of view it's not an ideal option, but it would be something you could live with if you know the caveats. The main problem here is that components might be long lived and there is no way to make sure that you create UserManager instances only when you need them and dispose them immediatiely afterwards. That's what IDbContextFactory makes possible.
This being said, using the UserManager or other identity services in Blazor Server components might cause you the following issues:
1. Concurrency issues
2. "Entity already tracked" exceptions
3. Other more imprevisible issues
If you are ware of this and you think you can implement safeguard conditions to recover from such exceptions, then you can use it. Without these safeguards you will get a lot of exceptions.
If you are making a query in the database, there is no sense in "ToLower", since the database is not sensitive to the registry
Depends on collation settings CS = Case Sensitive CI= Case Insensitive you need to have one or the other. AS = Accent sensitive, AI = Accent Insensitive.
I’m looking for how to tell Blazor where folders are, like the Areas/Identity etc. I’m pretty sure you showed that in one of your videos but I cannot find it. It’s probably where you added the Login links. Can you point me to the correct video?
I think it's this one ruclips.net/video/LBByZRhyZ8U/видео.html
If you have Windows Authentication and want to use Claims instead of Roles/Group Membership, how would you add Claims to the User and use those claims for authorization?
He has a video dedicated to Claims. It’s very good
How do i use Windows Authentication with that? For example act on a group membership instead of a city claim?
If you have Windows Authentication set up in your project then you can achieve this by simply adding a polici with RequireRole("Daomain\\Group") and it should work. It would be something like:
builder.Services.AddAuthorization(options => options.AddPolicy("MyRolOnly"), policy => policy.RequireRole("Domain\\Group")). That's how ASP.NET Core works in general. It is not related to Blazor in any way.
dont be confused by Authentication vs Authorization, they are different animals
Thanks Code Wrinkles
Any time
what about for example, when you need to authorize user to allow edit a product or not, what kind of logic we can apply ?
BTW This is a Really nice content
The Authorize component is used like the Authorize attribute in regular APIs. It means you can define custom policies and authorize each component by policy.
I am searching last one year for the topic 'Claims based authorization in Blazor Webassembly' but can't able to find out. Please provide tutorial for 'Claims based authorization in Blazor Webassembly and ASP.net MVC core Web API using JWT'. I am particularly asking for CREATE, DELETE and PRINT actions in a module. Actions buttons are provide corresponding to user. Please...
Blazor wazm authentication with login , logut and register : github.com/mammadkoma/attendance