【发布时间】:2019-03-12 03:16:16
【问题描述】:
我阅读了这个文档:http://docs.identityserver.io/en/release/endpoints/revocation.html
然后我试试这个代码:
AuthHelper.cs
public class AuthHelper
{
private string URL = "http://localhost:50847/connect/revocation";
public bool revocarToken(string token)
{
try
{
HttpClient client = new HttpClient();
string uri = URL;
StringContent contenido = new StringContent("token="+token+"&token_type_hint=access_token", System.Text.Encoding.UTF8, "application/x-www-form-urlencoded");
HttpResponseMessage response = client.PostAsync(uri, contenido).Result;
if (response.IsSuccessStatusCode)
return true;
return false;
}
catch (Exception ex)
{
throw;
}
}
}
但是,我得到了这个错误:
我收到错误 400(错误请求)。提前致谢。
【问题讨论】:
标签: c# asp.net-core identityserver4