Questions tagged [ocelot]

Ocelot is a .NET API Gateway.

Ocelot is a .NET API Gateway. This project is aimed at people using .NET running a micro services/service orientated architecture that need a unified point of entry into their system. However it will work with anything that speaks HTTP and run on any platform that ASP.NET Core supports.

In particular I want easy integration with IdentityServer reference and bearer tokens.

We have been unable to find this in my current workplace without having to write our own Javascript middlewares to handle the IdentityServer reference tokens. We would rather use the IdentityServer code that already exists to do this.

Ocelot is a bunch of middlewares in a specific order.

Ocelot manipulates the HttpRequest object into a state specified by its configuration until it reaches a request builder middleware where it creates a HttpRequestMessage object which is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. The response from the downstream service is retrieved as the requests goes back up the Ocelot pipeline. There is a piece of middleware that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. That is basically it with a bunch of other features!

Home repo

Documentations

273 questions
0
votes
0 answers

How to set JWT token to Stomp header while using Ocelot api gateway

I am using Stomp to establish a connection between frontend and backend. I use alb ingress to do the proxy and use Ocelot as API gateway to do the authentication. It works fine with normal http request. I did some search, seems like it is not…
michael
  • 83
  • 1
  • 5
0
votes
1 answer

How to allow multiple roles to access route through RouteClaimsRequirement

In a regular type scenario, where a Route is available, say to only "Premium" users, ocelot.global.json would have RouteClaimsRequirement like this: "RouteClaimsRequirement" : { "Role" : "Premium" } This would get translated to a…
ForWiz
  • 145
  • 1
  • 1
  • 10
0
votes
2 answers

Error if I invoke the microservice through the gateway with Ocelot 16.0

I am carrying out a project with apigateway and microservice Employees with visual studio 2019 with net.core 3.1 My configuration.json is: "ReRoutes": [ { "DownstreamPathTemplate": "/api/employees/{everything}", "DownstreamScheme":…
0
votes
1 answer

How define ocelot configuration for POST method controllers net core?

Actually in my Api service i have a method controller like: [Produces("application/json")] [ApiController] [Route("api/v1/[controller]")] public class LoginController: Controller { public LoginController(IConfiguration config) { ... …
Dr oscar
  • 359
  • 1
  • 4
  • 16
0
votes
0 answers

Ocelot gateway missing response headers

I am using Ocelot gateway for routing asp.net core micro-services but in case of aggregation its missing response headers(security header). Any solution?
Faisal
  • 45
  • 1
  • 8
0
votes
1 answer

ASP.NET Core 3.1 API Ocelot JWT Returns 401 on Login

I'm trying to implement the microservice architecture. I'm using ASP.NET Core 3.1 API to implement. I installed jwt packages ocelot and auth servers. When I try to log in, it returns 401. So, this part of my application is wrong. What is wrong with…
Ali
  • 1,358
  • 3
  • 21
  • 32
0
votes
1 answer

Error during WebSocket handshake: Unexpected response code: 502 when connecting on azure with ocelot gateway

I am using signalR in my application and get error when upload ocelot gateway on azure portal My ts code this.hubConnection = new signalR.HubConnectionBuilder() .withUrl("https://url.azurewebsites.net/gatewayOcelot/notification", { …
0
votes
1 answer

Ocelot API Gateway implementation in AKS

I'm creating AKS cluster, and I want to use API gateway (Ocelot ) to route, and authenticate requests towards containers(microservices) behind the gateway. My question is how to achieve this? I know I must deploy ocelot API gateway inside node, but…
user1598696
  • 550
  • 1
  • 4
  • 22
0
votes
1 answer

Ocelot Gateway Aggregation: When each API has different Query String parameters

I am working on microservice and I want to aggregate data from multiple Get calls with different Query parameters.…
MSH
  • 1
  • 2
0
votes
0 answers

Ocelat api gateway documentation with swagger

I've developed a project based on microservices(11 microservices) and used Ocelat for api gateway but I'm struggling with generate microservice api documentation, Ocelat says use this way to generate document by create swagger json file in gateway…
sa-es-ir
  • 3,722
  • 2
  • 13
  • 31
0
votes
1 answer

How add condition routing using Ocelot?

I have a Web API which has two endpoints: /tenant1/xxx /tenant2/xxx The Web API serves multiple tenants and it is hosted as a single instance. Now I have to public this Web API to the outside for using, from the third party, they don't need to…
Steve Lam
  • 979
  • 1
  • 17
  • 40
0
votes
2 answers

"Configuration config = new Configuration": 'Configuration' is a namespace but is used like a type

very new to .net and this seems like a simple questions. Trying to get this code to work from the Jaeger website: https://ocelot.readthedocs.io/en/latest/features/tracing.html services.AddSingleton(sp => { var loggerFactory =…
0
votes
1 answer

Aggregator gets empty responses when using Advanced Ocelot Request Aggregation

My ocelot config looks like below (only relevant parts): "Routes": [ { "DownstreamPathTemplate": "/api/service1/json/{pageSize}/{pageNo}/all/{partnerId}", "DownstreamScheme": "http", "UpstreamPathTemplate": "/a", …
Marek M.
  • 3,799
  • 9
  • 43
  • 93
0
votes
1 answer

How to Use Swagger with Ocelot in Asp.Net Core 2.1

I want to showcase all my endpoints of an API Gateway in Swagger. For gateway, I have used Ocelot with Asp.Net Core 2.1 but Ocelot's documentation says it does not support Swagger. Anyhow, if anyone can give suggestion on this?
0
votes
1 answer

Ocelot - gRPC service?

How I can use Ocelot Gateway for gRPC service in .Net Core 3.1? Ocelot not support gRPC or is there any way to integrate it? Hope to help, thank you!
user3836200
  • 111
  • 1
  • 13