admin管理员组文章数量:1400572
That's my YARP configuration:
builder.Services.AddReverseProxy()
.LoadFromConfig(builder.Configuration.GetRequiredSection("ReverseProxy"))
.AddTransforms(builder =>
{
builder.AddRequestTransform(async (ctx) =>
{
var accessToken = await ctx.HttpContext.GetTokenAsync("access_token");
ctx.ProxyRequest.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
});
});
and the problem is I want to refresh my access token when the response for proxied request is 401. Specifically, I want to get new access token using refresh token, set new cookie with new access token and retry request. But I can't find any documented way to do so if I'm using YARP.
本文标签: cHow to refresh access token when proxied request gets 401 response YARPStack Overflow
版权声明:本文标题:c# - How to refresh access token when proxied request gets 401 response YARP - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744270280a2598147.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论