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
1 answer

How to hide JWT key from my Ocelot api gateway?

I have a public ocelot api gateway with authentication through a jwt. The Key to check the JWT is within the start up within ocelot which is obviously very insecure. What are the best practises for hiding your JWT keys, particularly for an api…
0
votes
3 answers

How Do You Define a Kubernetes Service TargetPort as a String?

Thanos requires a targetPort defined as a string in the Service for the ServiceMonitor to communicate with it. However, just defining the targetPort as a string causes problems. I believe that something more is needed in the Deployment. I think the…
Matthew S
  • 900
  • 3
  • 12
  • 26
0
votes
1 answer

Ocelot Gateway authentication with OKTA

I am newbie to Identity Server. I am actually trying to authenticate JWT token generated by Okta provider from Ocelot gateway and allow access to the underlying API once the authentication is successful. I can actually generate ID and Access token…
DonMax
  • 970
  • 3
  • 12
  • 47
0
votes
1 answer

How to return Unauthorized response while overriding AuthorizationMiddleware in Ocelot & .Net WebApi

I'm tring to override Ocelot AuthorizationMiddleware using a OcelotPipelineConfiguration in .NET 5 WebApi. This is my code: UPDATED Configure public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAuthorizationService…
0
votes
0 answers

Link has been blocked by CORS policy: No 'Access-Control-Allow-Origin'

I am using Ocelot API gateway in between my front end and back end packages of Angular project. All API calls work fine but Delete call fails. It gives below error Access to XMLHttpRequest at…
user14463446
  • 99
  • 10
0
votes
2 answers

Can API Gateway point a to a Web Service (SOAP) or the alternative would be can SOAP be used in a microservice so that the API Gateway point to it?

So I'm using dotnet core 3.1, and working with a client that requires access to a web service. I was wondering if it's possible to use/integrate an API Gateway architecture so that the API Gateway points to that web service (SOAP messages)? I'm…
gustavexx
  • 25
  • 1
  • 5
0
votes
1 answer

how to send tenantid to downstream services when using ocelot with abp

I am currently using ABP and ocelot to build a api gateway for microservices. Everything works fine but now I want to use api gateway as a domain resolver. ABP's Domain Resolver works to resolve tenantid from different domains but i want ocelot to…
0
votes
0 answers

Ocelot not forwarding the body of the request

I built a very simple gateway with ocelot. In my architecture for now, users can request a token by sending a post request (containing the credentials in the body) through the gateway which will redirect it to the correct endpoint. The problem is…
Baz
  • 143
  • 3
  • 9
0
votes
1 answer

Ocelot api gateway - kubernetes - error: "namespace:serviceservice:managementservice Unable to use ,it is invalid. Address must contain host only...."

The problem that i am facing is that the ocelot kubernetservicediscorverProvider does not seem to find the other services on the name space in kubernetes.My goal is to use api gateway to call apis in the other services in the same namespace. I…
Programmer
  • 11
  • 1
  • 5
0
votes
1 answer

Ocelot gateway doesnt want to apply microservice route

Separating monolithic app into several microservice now i'm interested how to run them all together. So, I'm building ocelot gateway for this. And have some problems. I tried to link one simple microservice with main api. If i go to the gateway…
0
votes
2 answers

404 error: Trying to deploy ocelot gateway inside docker to call microservices

We have developed two ASP.NET CORE (5.0) microservices and deployed them inside docker http://localhost:28621/stock http://localhost:62362/user Both are easily accessible from browser. We have used ocelot gateway for API gateway. When we deployed it…
0
votes
1 answer

Use Accept header to remap request URL (api versioning using accept header)

Anyone can suggest a correct place to inject a code in ocelot (a handler or similar) to get a request, look at it and if there is a header "Accept" with version specs add it to the path. For a header value application/vnd.myapp.v2+json it would…
borys86
  • 1,894
  • 2
  • 13
  • 13
0
votes
1 answer

Ocelot can't find api when deployed to azure app service

I created an ocelot gateway that redirects to an api. this works file on localhost but as soon as i deploy the projects to azure app services ocelot stops working. the api still works though. I already set the DownstreamHostAndPorts to the api app…
0
votes
1 answer

Fix issue with custom response ".NET Core API Gateway Ocelot - Middleware"

Good day, I have an issue with a custom response in API Gateway Ocelot with Middleware. inside FormatResponse(context.Response) I change response for specific endpoint and I see the new response on debug but I receive the original Response in final…
M.Alhadad
  • 3
  • 4
0
votes
2 answers

Swagger plus Ocelot

I´m trying to implement a gateway with ocelot and swagger (https://github.com/Burgyn/MMLib.SwaggerForOcelot). I was able to configure everything well in my localhost, now I need to deploy my solution to kubernetes, but, because there are some…
niva rojas
  • 101
  • 1
  • 10