Very useful content. I had a queries about this role base authorization.. Can we put this authorization with roles for an action or controller dynamically instead of decorating hard coded Authorize attribute with its role. Cause role may varies or newly created in that case if I had a mechanism to set that role dynamically for any action or controller where ever I want..
Hello Kudvenkat, thank you very much for your videos. I have a problem with Role Based Authorization. When i insert [Authorize(Roles = "Admin")] in my AdminController and run the application. After logging and trying to navigate in /admin/listroles it redirect me back to the Login Page. (a continuous loop redirection to the login page). If i remove [Authorize(Roles = "Admin")] from AdminController everything works perfectly. Can you help me please!! Thanks in advance and have a nice day.
@@katarinasimic7614 sorry for the late reply, I only read your answer now. I confirm that the problem lay in the writing order of: app.UseAuthentication(); app.UseAuthorization();
I wrotem [Authorize Role="admin"] my application does not specify who the admin is. what happened behind the scene? means where and how our application does compare this admin to the admin store in database?
Great tutorial sir. Just want to ask what if i have to add authorization dynamically i.e i dont want to change code when i created a new role on controller level. what should i do? thanks for advance.
Good explanation, but it would help that at the start of your video inform people that in this video you will not show people how to setup roles. That is what I am looking for.
How do you make this dynamic? That is setting the access level on UI that can only be accessed by admin only. Excellent job u are doing here. Well appreciated
Great videos. It would be great if you can help with download the code/project used in these videos. Can you please tell me how I can download the code the same ?
Hello Ramazan - You can find the source code and set up instructors on the following page. Hope this helps. csharp-video-tutorials.blogspot.com/2019/11/aspnet-core-mvc-course-wrap-up.html
Hmm - Not entirely sure why it's going to 404 page. Can you give me a bit more context on what you are trying to do. In general as you might already know, asp.net core automatically redirects to /Account/AccessDenied path if we try to access a resource which we are not allowed to access. I have a feeling you might not have either AccessDenied action in the AccountController or the AccessDenied view in /Views/Account folder. It will be great if you let me know how you are getting along in fixing this.
Thank you, Kud. The last slide was especially helpful.
Very useful content. I had a queries about this role base authorization.. Can we put this authorization with roles for an action or controller dynamically instead of decorating hard coded Authorize attribute with its role. Cause role may varies or newly created in that case if I had a mechanism to set that role dynamically for any action or controller where ever I want..
Prefect, thanks Sir
great!!!!
Great tutorials! Thank you!
Hello Kudvenkat, thank you very much for your videos. I have a problem with Role Based Authorization. When i insert [Authorize(Roles = "Admin")] in my AdminController and run the application. After logging and trying to navigate in /admin/listroles it redirect me back to the Login Page. (a continuous loop redirection to the login page).
If i remove [Authorize(Roles = "Admin")] from AdminController everything works perfectly. Can you help me please!!
Thanks in advance and have a nice day.
I have the same problem. Have you solved it yet?
app.UseAuthentication();
app.UseAuthorization();
use is this order
@@katarinasimic7614
sorry for the late reply, I only read your answer now. I confirm that the problem lay in the writing order of: app.UseAuthentication();
app.UseAuthorization();
same problem and i have done with your solution. Thanks!
@@katarinasimic7614 thank you :)
Are you going to show how an Admin can do CRUD operation for users?
Thank you very much for this excellent series.
Hello Ray - Yes we will cover all the CRUD operations of users in the AspNetUsers identity database table. Please stay tuned.
@@Csharp-video-tutorialsBlogspot Thanks very much!
wonderful as usual Venkat. will you explain partial views in the upcoming videos?
Eglal - 100%. We will cover partial views as well. Thank you for the great suggestion.
great explanation, thank you very much
I wrotem [Authorize Role="admin"] my application does not specify who the admin is. what happened behind the scene? means where and how our application does compare this admin to the admin store in database?
hi venkat, how the [Authorize] attribute determine whether the user is Admin or something else without any query or code?
Nice Explaination sir...
Great tutorial sir.
Just want to ask what if i have to add authorization dynamically i.e i dont want to change code when i created a new role on controller level. what should i do? thanks for advance.
hi Venkat, how do we make sure that the logged in user can only modify own resources and not other resources in asp.net core web api?
Hi do you will have a video for dynamic authorization?
Hello Kimhong - Can you please explain what you mean by dynamic authorization and we will surely cover in our upcoming videos.
Thanks
As your video on the role bases authorization, the role is hard coded. How about role which get from databases?
Do you have the video where you show how the project was created step by step?
it's the whole playlist from the begining
you can find in his playlists
Good explanation, but it would help that at the start of your video inform people that in this video you will not show people how to setup roles. That is what I am looking for.
If you haven't already seen it: Create User roles
ruclips.net/video/TuJd2Ez9i3I/видео.html
I need an Help Sir. How can I enable Controller changes at running mode
How do you make this dynamic? That is setting the access level on UI that can only be accessed by admin only. Excellent job u are doing here. Well appreciated
Thank you so much
sir how can i set roles name dynamically ? here u are set hard code role name.
I have done the same but always getting access denied
try re-login
me too
relogin does not solve the issue
when it will be completed
Great videos. It would be great if you can help with download the code/project used in these videos. Can you please tell me how I can download the code the same ?
Can be found at drive.google.com/drive/folders/1z49q-8xkKu8N8VjdemYKTs_4IbzBeLWM
how can I reach that application
can you send link that application
Hello Ramazan - You can find the source code and set up instructors on the following page. Hope this helps.
csharp-video-tutorials.blogspot.com/2019/11/aspnet-core-mvc-course-wrap-up.html
@@Csharp-video-tutorialsBlogspot thanks
Sir, make a video on view components also
Sure Shahid - We will discuss .NET Core View Components in detail in our upcoming videos. Thank you for the suggestion.
how your page redirecting to AccessDenied page? Mine is redirecting to 404 page. Thanks in advance
Hmm - Not entirely sure why it's going to 404 page. Can you give me a bit more context on what you are trying to do. In general as you might already know, asp.net core automatically redirects to /Account/AccessDenied path if we try to access a resource which we are not allowed to access. I have a feeling you might not have either AccessDenied action in the AccountController or the AccessDenied view in /Views/Account folder. It will be great if you let me know how you are getting along in fixing this.
Need to add in yout AcountController
[AllowAnonymous]
[HttpGet]
public IActionResult AccessDenied()
{
return RedirectToAction("Login", "Account");
}
This is broken for 3.1