gpt4 book ai didi

Azure Ad 身份验证回复 url 包含 http 而不是带有 .netcore 中间件的 https - 如何强制执行 https?

转载 作者:行者123 更新时间:2023-12-02 23:25:25 24 4
gpt4 key购买 nike

注意 http 而不是 https。当我用 https 替换 http 时,我被重定向并成功接收不记名 token 。如何强制中间件生成的 url 包含 https?

中间件:

   services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
.AddAzureAD(options => Configuration.Bind("AzureAd", options));

重定向后创建的请求:

https://login.microsoftonline.com/6957e{...}825/oauth2/authorize?
client_id=747{...}9810&redirect_uri=http%3A%2F%2F {... continued url ...}

最佳答案

对于使用 Docker 并部署到 Azure 应用服务的用户:在您的 DockerFile 中添加以下内容:ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true

事实证明,AAD 重定向 uri 设置为 http 而不是 https

关于Azure Ad 身份验证回复 url 包含 http 而不是带有 .netcore 中间件的 https - 如何强制执行 https?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64066325/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com