Skip to content

Crediantials in Yarp #2290

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

You must be logged in to vote

How are you setting the credentials? (Don't show us the actual credentials 😆).

I suggest adding the header directly to the outgoing HttpRequestMessage using a request transform.
https://microsoft.github.io/reverse-proxy/articles/transforms.html#addrequesttransform

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<T…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by karelz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Type: Idea This issue is a high-level idea for discussion.
2 participants
Converted from issue

This discussion was converted from issue #2289 on October 25, 2023 16:33.