I'm trying to use RefreshTokenDelegatingHander but couldn't find any proper way or sample yet with Xamarin.forms. Has any one got any success? Here is what i tried:
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);
and inside my Login method after:
_result = await _client.LoginAsync(new LoginRequest());
I'm trying to use it with following:
var tokenResult = new RefreshTokenDelegatingHandler(_client, _result.AccessToken, _result.RefreshToken,_result.RefreshTokenHandler);
tokenResult.TokenRefreshed += OnTokenRefreshed; //This one is never called
Any one has any idea? or any example?