Implementing API Gateway With Ocelot in ASP.NET Core
ฝัง
- เผยแพร่เมื่อ 20 ต.ค. 2024
- ►► Master Web API development Best Practices: bit.ly/3TnqoFQ
►► Build great web apps in Blazor WebAssembly: bit.ly/437g87T
►► Support us on Patreon and get the source code: / codemaze
Hi everyone. My name is Marinko Spasojevic and in this video, I will talk about creating an API gateway for your microservices in ASP.NET Core.
An API Gateway acts as a mediator between client applications and the backend services within the microservices architecture. It is a software layer that functions as a single endpoint for various APIs performing tasks such as request composition, routing, and protocol translation.
To be able to create the gateway project, I will use Ocelot. Ocelot is an open-source API Gateway, designed for microservices architecture, and in this video, you will see how it makes the process of creating an API gateway so easy. Also, I will show you how we can cache results and implement Rate limiting using Ocelot.
LINKS MENTIONED IN THE VIDEO
►► Secure Microservices Using JWT With Ocelot - • Secure Microservices U...
FOLLOW US ON SOCIAL MEDIA!
►► / marinko-spasojevic
►► / codemazeblog
►► / codemazeblog
Thank you all for watching and for your support.
►► If you want to master Web API development using best practices, check out our Web API book: bit.ly/3x75ZMM
►► Also, to build great full-stack apps with Blazor, check out our course: bit.ly/3Pw3Y33
I just tried it, It worked like a charm. Super great video
Great to hear! Thank you for watching the video.
Ocelot looks promising in API Gateway and MS Patterns. Thanks Code Maze to bring this up!
You are very welcome. Yes, it is a great tool for MS.
amazing video men was the only one which helped me to set up everything approperly
I am glad to hear that. Thank you for watching the video. There is also one regarding authentication with Ocelot if you want to give it a try. Feedback is always appreciated.
Wow . thanks❤
You're welcome. Thank you for watching this one.
Thank you for touch this topic. It would be great if could explore service discovery concept.
Thank you for watching the video and the suggestion, it is a great one.
Excellent article! If the destination API has security (jwt token), how is the configuration in Ocelot to send the token in the header or does it automatically forward the received headers? Thank you!
To be honest, I wouldn't do it that way because you have to repeat the same logic for each microservices project that you want to protect. But if you have it in that one, you will probably have a separate endpoint for auth, and the ocelot part is the same. You just need to change the upstream part to target a proper URI and provide the proper auth configuration. In the next video that comes out tomorrow, you will see how I handle the auth with Ocelot and Microservices.
@@CodeMaze We are currently using Keycloak and the entire OIDC configuration in the APIs and frontends. I want to implement an ApiGateway, and I wanted to see what the security configuration would be like. Thank you very much for the reply.
You are very welcome. I hope the next video provided some useful info for you.
How to setup this communication in containerization in localhost. I want to setup gateway and functional microservice in localhost. I'm using docker compose for deploying multiple container.
We're going to publish a new course on Microservices very soon. This is a complex topic and hard to answer in a single comment or thread. If you want to, you can register at courses.code-maze.com and wait for the announcement of the course (est. 2-3 weeks). We're going to talk about it on the channel, in one of the future videos as well as well.
gracias :)
You are very welcome.
please where is the link to the video where you added authentication?
Hi. This video was recorded before the auth one, so I didn't link it in the description. But you can find both in the same playlist: th-cam.com/play/PLkOmPTFOxKBrtoebJJIiPVuCFIWuTLBvr.html
That said, I will add the link to that video in the description now.
Wasn't Ocelot Deprecated ?
Not that I know. It is widely used, and based on this: www.nuget.org/packages/Ocelot the new versin was released a month ago.