[英]Getting NullReferenceException when using refresh token in IdentityServer3
When refreshing my token using the IdentityModel client library.... 使用IdentityModel客户端库刷新令牌时...
var result = _tokenClient.RequestRefreshTokenAsync (refreshToken).Result;
I'm getting a NullReferenceException. 我收到了NullReferenceException。 This doesn't happen every time after getting an AccessToken and RefreshToken but only after the tokens are hours old. 在获得AccessToken和RefreshToken之后,并不是每次都发生这种情况,而只是在令牌使用了几个小时之后才发生。 For example, I can get a AT and RT and consistently use the RT to get more AT and RT and it works fine. 例如,我可以获取一个AT和RT,并始终使用RT来获取更多的AT和RT,并且效果很好。 Let the code sit for a few hours and try to use the RT again and it throws the error. 让代码搁置几个小时,然后尝试再次使用RT,它会引发错误。 StackTrack is below. StackTrack在下面。 I would think if it was some sort of simple expiration issue I would have got a more graceful isError=true in the TokenResponse object. 我认为,如果这是某种简单的到期问题,我会在TokenResponse对象中得到更优雅的isError = true。
at IdentityModel.Client.TokenClientExtensions.Merge (IdentityModel.Client.TokenClient client, System.Collections.Generic.Dictionary`2 explicitValues, System.Object extra) [0x00016] in <filename unknown>:0
at IdentityModel.Client.TokenClientExtensions.RequestRefreshTokenAsync (IdentityModel.Client.TokenClient client, System.String refreshToken, System.Object extra, CancellationToken cancellationToken) [0x00024] in <filename unknown>:0
at SellMore.Functions.RefreshToken (System.String refreshToken) [0x0001d] in /Users/darrell/Mono Projects/SellMore/SellMoreApp/SellMore/SellMore/Classes/Functions.cs:41
愚蠢的问题,我的_tokenClient变量为nul
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.