Skip to content

Is there a way to modify the cookies before it gets proxied? #2140

Answered by Tratcher
florianwachs asked this question in Q&A
Discussion options

You must be logged in to vote

You're on the right track with the CustomTransformer. A similar sample is here:

transformBuilderContext.AddRequestTransform(async transformContext =>
{
// AuthN and AuthZ will have already been completed after request routing.
var ticket = await transformContext.HttpContext.AuthenticateAsync("token");
var tokenService = transformContext.HttpContext.RequestServices.GetRequiredService<TokenService>();
var token = await tokenService.GetAuthTokenAsync(ticket.Principal);
transformContext.ProxyRequest.Headers.Authorization = new AuthenticationHeaderValue("Be…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@florianwachs
Comment options

Answer selected by florianwachs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants