我已经核对了大部分的问题,但没有找到答案。
我正在尝试从身份服务器获取一个JWT令牌。
下面是操作步骤:
var discoveryDocument = new DiscoveryDocumentRequest Address = "https://admin.blabla.app:5000/", Policy = RequireHttps = false var auth = httpClient.GetDiscoveryDocumentAsync(discoveryDocument).Result;
我得到的错误是 An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.
An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.
DiscoveryDocumentRequest
{ "Policy": { "LoopbackAddresses": [ "localhost", "127.0.0.1" "Authority": "https://admin.blabla.app:5000", "AuthorityValidationStrategy": {}, "RequireHttps": false, "AllowHttpOnLoopback": true, "ValidateIssuerName": true, "ValidateEndpoints": true, "EndpointValidationExcludeList": [], "AdditionalEndpointBaseAddresses": [], "RequireKeySet": true "Address": "https://admin.blabla.app:5000/", "ClientId": null, "ClientSecret": null, "ClientAssertion": { "Type": null, "Value": null "ClientCredentialStyle": 1, "AuthorizationHeaderStyle": 0, "Parameters": [], "Version": { "Major": 1, "Minor": 1, "Build": -1, "Revision": -1, "MajorRevision": -1, "MinorRevision": -1 "Content": null, "Method": { "Method": "GET" "RequestUri": null, "Headers": [ "Key": "Accept", "Value": [ "application/json" "Properties": {} }
此代码位于windows服务上。
有趣的事实:相同的代码在不同的windows机器上工作。为什么?有什么问题吗?
发布于 2021-07-31 18:49:19
请参阅此 示例 ,并请写:
var client = new HttpClient();