ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.32k stars 1.63k forks source link

Aggregation not working when the Downstream has authentication #1109

Closed rusodan closed 6 months ago

rusodan commented 4 years ago

Expected Behavior

Get an unique result in one call from different microservices

Actual Behavior

The result of microservices is empty because are unauthorized. With microservices that has no security, the aggregation is working fine.

Example

If I try any microservice individually, they return the expected result (I have authentication in both microservices):

image

After login, I see the correct user (DanielCol) in the result of both microservice: image

image

If I use the aggregation, I see empty result from both services: image

Unauthorized error is raised in both: image

Any way to fix this?

This is my custom aggregator: image

The configuration of the aggregate: image

And the microservices: image

Another test

I added NTLM authentication to the net core app: image

image

And I tried to pass those credentials to the aggregation but I don´t know how, may be in the AuthenticationMiddleware.

Specifications

raman-m commented 6 months ago

@rusodan Add anonymous route to allow anonim traffic goes to authentication endpoint. Or exclude authentication endpoint from Ocelot config at all to get token/cookie and other auth artifact to allow your auth route working.