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
3
votes
2 answers

Microservices Api gateway and Identity Server 4 kubernates

I have microsevices and SPA app. All of them run on docker with docker compose. I have ocelot api gateway. But gateway knows ip address or container names of microservices for reaching . I add a aggregater service inside ocelot app. And I can…
eren arslan
  • 197
  • 2
  • 11
3
votes
1 answer

How to make Identityserver redirect to my web app?

i am trying to integrate Identity Server 4 with Ocelot and authenticate WebApp (asp.net core 3.1) then access the api if request is authenticated. for this i have created a solution having Gateway- Ocelot(latest) IdentityService - Identity Server…
3
votes
0 answers

Ocelot Configuration is restoring after restart

I am trying to implement the Ocelot gateway, and I am using admin APIs for updating the configuration on runtime. So the issue is when I am updating the configuration it is updating the file in bin folder which is expected behaviour, but when I…
Manish
  • 1,139
  • 7
  • 21
3
votes
1 answer

Documentation for Ocelot - Authentication

I am trying to learn and look into splitting up my current asp.net api into a bunch of smaller apis to try and make a microservices application (Mainly for learning purposes). I am using Ocelot as gateway and I have found Ocelot nice and easy to set…
Arthos
  • 443
  • 1
  • 5
  • 7
3
votes
0 answers

Ocelot gateway: No such host is known

I'm using Ocelot as gateway and Consul as Service Discovery. I have an error after the first API call Ocelot Gateway in Ocelot.Errors.Middleware.ExceptionHandlerMiddleware[0] My output log is here: Hosting environment: Development Now listening on:…
Saeid Mirzaei
  • 950
  • 2
  • 18
  • 48
3
votes
1 answer

Ocelot Integration with Azure Active Directory Authentication .Net Core 3.1

Context: My company is moving to an API Gateway to manage all our or services in our network. Each service is currently authenticated using azure AD. Everything is single tenant and just allows company users. Question: Am I understanding this…
3
votes
1 answer

Ocelot with multiple Configuration files and Environments

Is there any way to use Ocelot with multiple Configuration files and environments like ocelot.service1.Development.json? Unfortunately the documentation seems to be outdated and also it doesn't handle my specific request. I saw that it is able to…
SNO
  • 793
  • 1
  • 10
  • 30
3
votes
1 answer

Ocelot API Gateway Optional Parameter

Is there a way to tell Ocelot that a parameter is optional? Let's say the query param below is optional: "DownstreamPathTemplate": "/api/SearchAPI/?query={query}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host":…
Izzy Rodriguez
  • 2,097
  • 3
  • 21
  • 32
3
votes
1 answer

IDX10214: Audience validation failed. Audiences: '[PII is hidden]'

I have web app using azureb2c for authentication. Have 3 APIs which are called by web app via Ocelot gateway using HttpClient. After authentication, when a request is made to an API via gateway the request is made to the specific API and the…
3
votes
0 answers

Service discovery ASP.Net Core with Ocelot

I may be wrong in my ideas but here the plan. I have an app who has 2 services, with a client who consume these services. Because I want them to be micro-services, I've planed to build an API Gateway to have only one access point and redirect…
Maillful
  • 77
  • 1
  • 6
3
votes
1 answer

How can I stop a request in Ocelot's PreAuthenticationMiddleware?

I have to do some checks on the request's jwt before ocelot authentication, so I'm doing them within the PreAuthenticationMiddleware like this: var config = new OcelotPipelineConfiguration { PreAuthenticationMiddleware = async (ctx, next) => …
Doc
  • 5,078
  • 6
  • 52
  • 88
3
votes
1 answer

Dynamic service name with ocelot and consul

I am using Ocelot and API gateway with Consul and the service discovery. I am registering services in the Consul with dynamic names like : service.name.1234 and service.name.5678 This services are statful and not meant to be scaled at all Since i am…
IB.
  • 1,019
  • 3
  • 13
  • 21
2
votes
0 answers

Ocelot gatway doesn't work with selected port

I want to use ocelot middleware with full dns address. But If I sent request to selected port postman says ECONNREFUSED. If I change the port it doesn't help me. I added ocelot.json and ocelot.developments.json file but it also doesn't help me. Note…
2
votes
2 answers

How to add JsonArrayObject in JsonArray

Here I am trying to implement Ocelot for API Gateway for my multiple micro services. I have Seven Micro services which have lots of API almost 550 APIs. While preparing ocelot.json it is a huge file which seems unmaintainable. For which I want to…
Iswar
  • 2,211
  • 11
  • 40
  • 65
2
votes
0 answers

Introspect the id_token to send claims from token to microservices? Ocelot and OpenIdDict

I am using ocelot api gateway to authenticate the request and pass the claims to the underlying micro services. So far i am able to get the access_token as well as the id_token. Is there a way i can introspect the id_token so that the claims from…
1 2
3
18 19