使用Authing.Library 0.0.29时,
_authenticationClient.SetToken("...");
导致以下错误:
---> System.Exception: {"statusCode":404,"error":"Not Found","message":"Cannot GET /https://onetrust.authing.cn/oidc/.well-known/jwks.json"}
at Authing.ApiClient.Domain.Client.Impl.Client.AuthingClient.RequestCustomData[TResponse](String url, String serializedata, Dictionary`2 header
s, HttpMethod method, ContentType contenttype)
at Authing.ApiClient.Domain.Client.Impl.Client.BaseClient.RequestNoGraphQlResponse[TResponse](String url, String serializedata, Dictionary`2 he
aders, HttpMethod method, ContentType contenttype)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Authing.ApiClient.Domain.Client.Impl.AuthenticationClient.AuthenticationClient.CheckLoggedIn()
at Authing.ApiClient.Domain.Client.Impl.AuthenticationClient.AuthenticationClient.SetToken(String token)
经过调试,可能是由于Authing.Library的这行代码:https://github.com/Authing/authing-csharp-sdk-neo/blob/36aacdc49251f0e37b8610e7f024b95b187b936c/Authing.ApiClient/Domain/Client/Impl/AuthenticationClient/AuthenticationClient.cs#L94
调用了这行代码:https://github.com/Authing/authing-csharp-sdk-neo/blob/36aacdc49251f0e37b8610e7f024b95b187b936c/Authing.ApiClient/Domain/Client/Impl/Client/BaseClient.cs#L73
导致后者在"https://…“前加了一个额外的”/"?
用调试器在AuthenticationClient.CheckLoggedIn()
内可以看到:
dictionary2["iss"].ToString()
"https://onetrust.authing.cn/oidc"
this.Host
"https://core.authing.cn"
所以不知道为什么结果是变成了"/https://onetrust.authing.cn/oidc/…",而不是"https://core.authing.cn/https://onetrust.authing.cn/oidc/…"(虽然后者也不对)。