找不到IdentityModel.Client.TokenResponse.get_ExpiresIn()方法

时间:2018-08-07 04:12:07

标签: c# asp.net asp.net-mvc asp.net-core identityserver4

使用服务器到服务器与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()'

0 个答案:

没有答案