Skip to content

How to handle HTTP 307/308/301 with Authorization header? #2247

Answered by raman-m
jvmlet asked this question in Q&A
Discussion options

You must be logged in to vote

How does Ocelot support the custom authentication module (DelegateHandler I suppose) in case AllowAutoRedirect is set to true?

As I've already explained you, if auto-redirects is enabled in route configuration then Ocelot delegates behavior to SocketsHttpHandler when the user has enabled the AllowAutoRedirect property.
And Ocelot has no custom auth Delegating Handlers in its pipeline, because Ocelot's "authentication module" is AuthenticationMiddleware which reads Authorization header implicitly based on app startup code and auth provider setup.

I see 2 options:
1 Add another config property to PropagateAuthorizationHeaderOnAutoRedirect

It could be a new Ocelot feature but who will de…

Replies: 13 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@raman-m
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@raman-m
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@raman-m
Comment options

@raman-m
Comment options

Answer selected by raman-m
Comment options

You must be logged in to vote
2 replies
@raman-m
Comment options

@jvmlet
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Authentication Ocelot feature: Authentication Authorization Ocelot feature: Authorization
2 participants
Converted from issue

This discussion was converted from issue #2245 on January 09, 2025 11:19.