使用服务器到服务器与Identityserver 4.中的IdentityServerClientTools通信。不断获取 IdentityModel.Client.TokenResponse.get_ExpiresIn()方法未找到
echo get_class(($this->mailProvider)());
我正在使用以下版本
public class UserManagementController : BaseController
{
private readonly IdentityServerClientTools _identityServerClientTools;
private readonly IdSvrUserManager _userManager;
public UserManagementController(IdentityServerClientTools identityServerClientTools, IHttpContextAccessor httpContextAccessor)
{
_identityServerClientTools = identityServerClientTools;
_userManager = new IdSvrUserManager(identityServerClientTools, httpContextAccessor);
}
[HttpGet("search")]
[ProducesResponseType(typeof(PagedListWrapper<IdSvrUser>), (int)HttpStatusCode.OK)]
public async Task<IActionResult> Find(IdSvrUserCriteria criteria)
{
using (var client = _identityServerClientTools.CreateHttpClient())
{
var accessToken = await HttpContext.GetTokenAsync(IdSvrUserManager.AccessTokenAuthorizationKey);
client.SetBearerToken(accessToken);
var queryString = IdentityServerClientTools.BuildQueryStringForObject(criteria);
var result = await client.GetAsync($"{_identityServerClientTools.Authority}{IdSvrUserManager.UserManagementBaseUrl}/?{queryString}");
var responseString = await result.Content.ReadAsStringAsync();
return new IdSvrRelayedContentResult(result.StatusCode, responseString, result.Content.Headers.ContentType?.MediaType, result.Headers);
}
}
}
错误
未找到方法:'Int64 IdentityModel.Client.TokenResponse.get_ExpiresIn()'
。