- 391
- 1 856 548
Codewrinkles
Приєднався 9 бер 2018
Your daily does of #DotNet videos. We cover a wide variety of topics like #AspNetCore, #Blazor, EntityFramework Core, software architecture and so much more. You'll also find here regular live coding sessions.
ASP.NET Core WebAPI Authentication And Authorization Made EASY
Join this channel to get source code access and other perks:
ua-cam.com/channels/yTPru-1gZ7-4qblcKM0TiQ.htmljoin
Authentication and Authorization in an ASP.NET Core WebAPI using JWT Bearer is something many people fear, because it seems very complicated. Not anymore! This video is your ultimate guide to ASP.NET Core Authentication and Authorization. We'll understand how to leverage the power of Microsoft AspNet Core Identity and the default authorization engine by implementing our own authentication endpoint. While doing this we'll understand how to generate JWTs in .NET, how can we work and persist claims and roles, so that we can use them for authorization purposes. Last but not least, we'll see how easy it is to perform role based authoirzation in ASP.NET Core.
Content:
1. Intro: 00:00
2. JWT settings: 02:40
3. Options Pattern: 04:38
4. Generating JWTs: 05:56
5. IdentityDbContext: 08:45
6. Configuring JWT Authentication: 10:35
7. Configure Auth in Swagger: 15:31
8. User registration: 17:23
9. User login: 23:35
10. Role-based authorization: 25:49
11. Testing it all out: 28:00
ua-cam.com/channels/yTPru-1gZ7-4qblcKM0TiQ.htmljoin
Authentication and Authorization in an ASP.NET Core WebAPI using JWT Bearer is something many people fear, because it seems very complicated. Not anymore! This video is your ultimate guide to ASP.NET Core Authentication and Authorization. We'll understand how to leverage the power of Microsoft AspNet Core Identity and the default authorization engine by implementing our own authentication endpoint. While doing this we'll understand how to generate JWTs in .NET, how can we work and persist claims and roles, so that we can use them for authorization purposes. Last but not least, we'll see how easy it is to perform role based authoirzation in ASP.NET Core.
Content:
1. Intro: 00:00
2. JWT settings: 02:40
3. Options Pattern: 04:38
4. Generating JWTs: 05:56
5. IdentityDbContext: 08:45
6. Configuring JWT Authentication: 10:35
7. Configure Auth in Swagger: 15:31
8. User registration: 17:23
9. User login: 23:35
10. Role-based authorization: 25:49
11. Testing it all out: 28:00
Переглядів: 2 019
Відео
Microservices Are Evil - Live Podcast with Bulent Karaahmed
Переглядів 1,3 тис.14 днів тому
Everybody pitches microservices nowadays. Truth is, microservices are evil and thos who pitch them usually don't tell you the whole story. During my recent trip to Sofia, I sat down with Bulent Karaahmed (Technical Director at Amdaris) and discussed why microservices are evil and why starting with a monolith is in 90% of the cases the best way to go. We cover topics like microservices communica...
Azure Service Bus Queue vs Topic EXPLAINED
Переглядів 812Місяць тому
#Azure Service Bus is a great tool to implement asynchronuous messaging in your systems. But what's the difference between Azure Service Bus Queue and Topic? You might be surprised, but a lot of people fail to unuderstand it. Not anymore! In this video I'll show you a simple and practical setup that showcases the difference between Azure Service Bus Queue and Topic. Bot only that. I also give s...
Practical Write-Ahead Logging In DIstributed Systems
Переглядів 1,1 тис.Місяць тому
One of the major problem with distributed systems nowadays is that we usually work with very high level abstractions and we don't understand anymore how a distributed system is supposed to work, what challenges do we have and what patterns of distributed systems we can use to overcome them. In this video I dive deeper into the concept of write-ahead logging in distributed systems. What problems...
Numeric data types
Переглядів 6393 місяці тому
Join this channel to get source code access and other perks: ua-cam.com/channels/yTPru-1gZ7-4qblcKM0TiQ.htmljoin Content: 1. Intro: 00:00
Introduction To Data Types And Variables (For Absolute Beginners)
Переглядів 4583 місяці тому
Data Types and Variables are a fundamental topic of programming in general. If you are e beginner, this video is the last one you need to watch about data types and variables in programming! Join this channel to get source code access and other perks: ua-cam.com/channels/yTPru-1gZ7-4qblcKM0TiQ.htmljoin Content 1. Intro: 00:00
How To Add Google Authentication To Blazor SSR
Переглядів 2,3 тис.3 місяці тому
Implementing Google Authentication in Blazor is something that you might need to do sooner rather than later. So, Codewrinkles got you covered! In this video we dive into understanding the authentication flow when it comes to external identity providers. We start really from scratch, by showing you what exactly you need to configure in the Google Developer Console to establish a trust relations...
Introduction To Blazor Authentication in .NET 8
Переглядів 10 тис.3 місяці тому
Blazor Authentication can be a tricky subject in .NET 8. The reason for this is that authentication has drastrically changed when compared to how we implement it in earlier versions, no matter if Blazor WebAssembly or Blazor Server. Therefore in this video my aim is to walk you through what has changed and explain you exactly how authentication works in Blazor in .NET 8. We'll also tackle some ...
Here's WHY You Struggle With Software Architecture!
Переглядів 2,5 тис.3 місяці тому
Here's WHY You Struggle With Software Architecture!
Blazor VS. NextJS Head To Head! Which One Wins?
Переглядів 5 тис.3 місяці тому
Blazor VS. NextJS Head To Head! Which One Wins?
That's NOT How Async And Await Works in .NET!
Переглядів 12 тис.4 місяці тому
That's NOT How Async And Await Works in .NET!
The Biggest ISSUE With Blazor (and how to fix it)
Переглядів 8 тис.5 місяців тому
The Biggest ISSUE With Blazor (and how to fix it)
Escaping The .NET 8 Blazor Redirect To Login Hell
Переглядів 5 тис.5 місяців тому
Escaping The .NET 8 Blazor Redirect To Login Hell
DON'T Use DbContext In Blazor Interactive Server Components! (.NET8)
Переглядів 6 тис.6 місяців тому
DON'T Use DbContext In Blazor Interactive Server Components! (.NET8)
Everything You Need To Know About Blazor in .NET 8
Переглядів 11 тис.6 місяців тому
Everything You Need To Know About Blazor in .NET 8
Blazor Server Full CRUD Operations From Scratch Incl. EF Core
Переглядів 4,5 тис.6 місяців тому
Blazor Server Full CRUD Operations From Scratch Incl. EF Core
How To Ensure Code Quality in Your .NET Projects
Переглядів 2,5 тис.6 місяців тому
How To Ensure Code Quality in Your .NET Projects
Getting Started With .Net, Docker And Azure Container Instances
Переглядів 4,6 тис.7 місяців тому
Getting Started With .Net, Docker And Azure Container Instances
This Will Make Your Repositories Obsolete
Переглядів 6 тис.9 місяців тому
This Will Make Your Repositories Obsolete
Moq Uses Your Personal Information!!!
Переглядів 6 тис.9 місяців тому
Moq Uses Your Personal Information!!!
Streaming Videos From Azure Blob Storage in Blazor Server
Переглядів 2,4 тис.9 місяців тому
Streaming Videos From Azure Blob Storage in Blazor Server
Can I Run .NET 7 Minimal API in a Windows Service?
Переглядів 7 тис.9 місяців тому
Can I Run .NET 7 Minimal API in a Windows Service?
PRACTICAL Refactoring of MediatR Request Handlers
Переглядів 2,7 тис.9 місяців тому
PRACTICAL Refactoring of MediatR Request Handlers
All You Need To Know About IHttpClientFactory in ASP.Net Core
Переглядів 7 тис.9 місяців тому
All You Need To Know About IHttpClientFactory in ASP.Net Core
Sharing Context Between MediatR Components
Переглядів 1,4 тис.10 місяців тому
Sharing Context Between MediatR Components
Using MediatR Pipeline Behaviors For Database Transactions
Переглядів 2,8 тис.10 місяців тому
Using MediatR Pipeline Behaviors For Database Transactions
Most strange thing to me is when you are using IResult, the final response is wrapped in the special object with fields like: status, errors, traceId.... . So, for example lets take an implementation of pagination. The props like pageNumber and pageCount must be presented in the final response. So We have to create another level of wrappers for your response or change the IResult wrapper object. How can we put the pageNumber and pageCount prop inside IResult wrapper object?
very usefull. very good thank you very much in this world and hope all best wishes in the future worlds
Indeed it fixes. However, when you switch to @rendermode @(new InteractiveServerRenderMode(prerender:false)), you're indicating that you want to disable prerendering. Prerendering can sometimes cause issues with JavaScript execution because the page content is generated on the server and sent to the client before JavaScript can fully load and execute. This can lead to JavaScript code not finding elements it expects to interact with. I know you can do OnAfterRenderAsync and call your js functions there, but it can be a pain for apps that are migrating to Blazer and already have extensive javascript. This is still the best way to fix it so far.
You're the man, Dan! This is the best tutorial on the topic I've found.
I know the background music is very low but is it necessary? Also, doesn't this just make the solution more messy if you need to create a new validation class for each and every request handler when you can do it directly in there?
I know that it is for the purposes of the demo but it should be noted that you don't store the FirstName and LastName in the database as claims. You might include them in the claims in the token but they definitely do not belong in the claims table in the DB.
Is .net 5 support standard and .net core?
When the page is refreshed, the issue is not resolved even though it works for the initial rendering.
Thanks! Have a coffee on me!
Thanks a lot, but it was not necessary. You already give me a coffee each month through the mebership.
You've been working extra hard lately, Dan, and we all appreciate your efforts!
On my side of the planet (UTC+4 USA Eastern time) I had to make a slight change in the IdentityService class, GetTokenDescriptor method for UTC expiry time. I changed "Expires = DateTime.Now.AddHours(2)," to "Expires = DateTime.NowUtc.AddHours(2)" to properly set the property greater than the creation time on TokenDescriptor return value. Great video and code! Thanks, Dan!
Why not from within Visual Studio Identity Management? Everything is ready
very good , can u explain use with clean architecture?
Just stay tuned for next week :)
A big thank you!!
Your solution works great! If user types localhost:3333 it redirects him to localhost:3333/login if he's not logged in. How can I redirect him to chosen page if he's actually logged in and he types base page address e.g. localhost:3333 => localhost:3333/awesome-page?
What's a good way to deal with Task.WhenAll exceptions?
Great Video Dan, Thanks! Greatly explained.
Glad you enjoyed it!
Fantastic video, you have a great way of explaining these things. In details, but with full clarity! Please continue the series 🎉
Thanks, will do!
I am learning a lot with your videos, Thank you
Glad to hear that! Thanks for watching!
very helpful. does it work if the app service is container base?
Unfortunately many people falling into the trap which is called Automapper. Stay away from that, you will be much happier, believe me.
Would you like make videos about authentication and authorization using JWT with Blazor NET8 auto render mode This approach has many difficulties
I probably won't do a video on this topic as I don't think it should be an approach in a Blazor app. Blazor comes with its own authentication/authorization mechanisms and we should use them. I can't really understand why people still want to stick to JWT even in the SSR world. And I'm not talking here only about Blazor, but also about NextJS, Angular Universal and so on. I think we as developers should adapt to these new ways of rendering web application and not try to apply archaic techniques to modern technology.
@@CodewrinklesWhen making simple applications for our own use, we can choose how modern technologies we want to use. In real life, however, we often don't have this option - if, for example, we are forced to do an integration with an existing SSO, we have to adapt to its mechanisms: if it uses JWT (and this is very likely), we will also have to use JWT - even if Blazor offers a solution better tailored to its needs.
One of the best explanations, Thank you
Glad it was helpful!
Gigachad <3
Nice vídeo!
Thanks Dan! In this way, dont you use EF to add tables of users in your DB?
The best explanation about Blazor on the web that I think too! Congrats!
Randomly saw this today, to check my understanding, covered everything in a short video. I generally don't comment, but great work 😀. Now will see more videos here 😅
Glad you enjoyed it!
Very much practical and well explained.
what if you have huge data like 100000000comments in Post object. I don't think you can init a domain object with that much... looks useless to me when dealing with large chuncks of data. Thoughts?
I think that's a problem no matter if you use DDD or not. And the answer to it is sime: you don't load all data at the same time. You introduce paging or fltering based on other data poits that are important for your domain. If you take a look at literally all planet scale apps out there, you'll see that all of them use this approach
realy enjoyed the podcast. waiting to the next modular monolith podcast
I'm so glad you enjoyed it!
Given your heavy accent and rapid speech, I find this video rather challenging to follow, making it less useful for me.
Wow, that's some very constructive feedback. Thanks
This is the inconvenient truth about DDD. The persistence hell. To be clear you are the only content creator who deals with updates and I fully respect that. All others (including paid trainings) does not event talk about that part as it is really tricky. Imagine a form where the user submits all changes at once. Multiple addresses, perhaps last and first name at the very same time using a single DTO in its call. That is where DDD falls apart or creates persistance very complex at least. The maintainability suffers. Today with Blazor where you do not need a DTO and you can throw in an existing object it is even trickier.
In one of previous videos you explained using old Razor Pages to handle user authentication to Blazor Server Application is the most right method to set right cookies and handle HttpContext on initial state. Is it still actual in NET8?
Actually. that doesn't apply to the new Blazor. Please take a look at this video where I explain what changed: ua-cam.com/video/asa2ucbZlCI/v-deo.html
I remember about 7-8 years ago when Microservices started to gain traction, they had a mystique about them, the people doing the interviews didn't really know enough about the architecture.....spin on 7 years and they are hardly talked about ....Message Brokers are the way to go, just swapping the interface class!
After a long time, the king returns Sup, Dan :)
My absence was mostly due to the fact that I was traveling the last 3 weeks and a half. Work related. This video is one of the redults :)
you lost a lot of weight
Yep. Around 54 kg.
@@Codewrinkles Let me guess, you did an operation, I mean basically cutting most of your stomach ?
The weight loss ocurred over 10 months. I'm doing a lot of sport lately.
@@Codewrinkles I know a lot of people who have done it, not the best way to lose weight especially the saggy skin after the weight loss, but you look great. Please take care of your health.
❤ u r brilliant
You are brilliant no doubt ❤
I'm not. But Bulent is :). I was glad I could have this talk with him.
Why in C# to make an API call is such a huge deal...
Genial, era lo que venia buscado hacer hace tiempo, gracias.
How would you model Employees and Customers? My first thought would be to have 2 different tables that link to the User. But then how to differentiate the different users? Have a userType or maybe a Role?
[DataAnnotations] above the model fields are so simple man. A declarative and intuitive way to understand whats being validated. Not only that but controllers serialized results to the client automagically out of the box. What we are doing here is perpetuating the change for change sake mantra due to the need to widen the developer base and anything but 'minimal'. At this rate .NET will complete its trip from 'object oriented' to 'functional programming spaghetti code' (current state) to....yes...Javascript.
I totally agree with you!
Great video, thanks for sharing this with us! I am wondering how we do model validation with attributes like [Required] and specify the rules on the field. Then, have the filter to check these rules. So we can see the request validation and message on the object itself rather than find out this in another file.
Relax brother! Life is too short to get angry at LinkedIn influencers.
I keep getting an error when running the application locally and I submit a post request with the name and price. It says Executed “ProductsGetAllCreate” failed. Exception while executing function. Format of the initialization string does not conform to the specification starting at index 0.
Hei nice video, I wonder if we can put all the actions that a user can perform inside a model instead of putting it inside a service?
The best explanation of blazor in .NET8 I've found on the internet. Congratulations and thank you, I will definitely watch the whole series.
just a question I wish an answer for it I created a project using N tier Arch (I did this project following an instructor) But it wasn't like that, the models was In the data Access layer and the Abstraction repos and its implementation were in the Business Logic layer so that structure confused me weather it should be like you did or what I had did.
Your channel is pure gold. Thank you for your effort
The video is good, an interesting topic, but it would be extremely convenient if there were links to resources For example, your telegram channel or something similar, which usually happens to others, because it is a little difficult to search. I would be extremely grateful :)