Enhancing Ocelot to Automatically Forward Claims from IdentityServer's Introspection Endpoint to Backend Services #2043
Replies: 1 comment
-
Niyozbek,
To forward the claims means to forward auth token. Just define anonymous route to forward your token down to the service. Authorization will occur on the side of the downstream service.
Hmm... What's the problem with that?
Great! Sure thing you can do that!
But I've explained you above how. Make token once, and reuse it for all Ocelot's routes. But they should be anonymous! So, authorization will take place on microservice's side.
Awesome Steps to Reproduce! 🤣 Hope it helps!
Why do you use outdated version? |
Beta Was this translation helpful? Give feedback.
-
We expect Ocelot to forward the claims obtained from IdentityServer4's introspection endpoint to the backend services, enabling efficient authentication and authorization within our microservice architecture.
Currently, Ocelot does not forward the claims retrieved from the introspection endpoint to the backend services. This leads to inefficiencies, as each microservice must independently query IdentityServer4 for claims, resulting in unnecessary round trips.
To optimize our authentication and authorization process, we aim to enhance Ocelot's functionality. Specifically, we seek a feature that automatically passes the obtained claims from the introspection endpoint to the backend services, reducing reliance on IdentityServer and minimizing round trips.
Configure Ocelot as the API Gateway in a microservice architecture.
Integrate IdentityServer4 for authentication and authorization.
Ensure each microservice sends requests to IdentityServer4's introspection endpoint to retrieve claims.
Observe that Ocelot does not forward the obtained claims to the backend services.
Version: Ocelot 18.0
Platform: .NET 6
Subsystem: Authentication and Authorization
Beta Was this translation helpful? Give feedback.
All reactions