【发布时间】:2023-03-20 08:02:01
【问题描述】:
当我使用 OpenIdConnect 时,我在 OpenIdConnectHandler(394 行)中遇到问题
所以,我使用西里尔文域 http://грант-лев.рф(仅作为示例),并且 OpenIdConnectHandler 中的重定向 URI 看起来不正确:
The redirect URI is not well-formed. The URI is: 'http://грант-лев.рф:5000/connect/authorize?client_id=RosgrantService&redirect_uri=http%3A%2F%2Fxn----7sbhbm9amwu.xn--p1ai%3A5002%2Fsignin-oidc&
似乎,像这里一样的 punycode redirect_uri=http%3A%2F%2Fxn----7sbhbm9amwu.xn--p1ai
会很好,但我不知道我可以在哪里处理它。
此外,在这个警告之后,我在 kestrel 中发现了一个异常
System.InvalidOperationException: Invalid non-ASCII or control character in header: 0x0433
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.FrameHeaders.ThrowInvalidHeaderCharacter(Char ch)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.FrameHeaders.ValidateHeaderCharacters(String headerCharacters)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.FrameHeaders.ValidateHeaderCharacters(StringValues headerValues)
....
那么,如何将我的西里尔文域转换为 punycode 以防止在 OpenIdConnectHandler 中出现警告和 Kestrel 崩溃?
更新: 它可能有用 https://github.com/aspnet/Security/issues/1646
我还通过一些变通方法解决了一个问题 http://amilspage.com/set-identityserver4-url-behind-loadbalancer/
【问题讨论】:
标签: .net asp.net-core asp.net-core-mvc openid-connect