我正在尝试使用RefreshTokenDelegatingHander ,但无法使用 Xamarin.forms 找到任何合适的方法或示例。有人成功了吗?这是我尝试过的:
var options = new OidcClientOptions
{
Browser = browser,
RedirectUri = IdentityConstants.RedirectUri,
Authority = IdentityConstants.Authority,
ClientId = IdentityConstants.ClientId,
ClientSecret = IdentityConstants.ClientSecret,
ResponseMode = OidcClientOptions.AuthorizeResponseMode.Redirect,
Scope = IdentityConstants.Scope,
RefreshTokenInnerHttpHandler = new HttpClientHandler()
};
_client = new OidcClient(options);
在我的登录方法之后:
_result = await _client.LoginAsync(new LoginRequest());
我正在尝试将其与以下内容一起使用:
var tokenResult = new RefreshTokenDelegatingHandler(_client, _result.AccessToken, _result.RefreshToken,_result.RefreshTokenHandler);
tokenResult.TokenRefreshed += OnTokenRefreshed; //This one is never called
任何人有任何想法?或任何例子?