Beispiel #1
0
        public async void Update(RefreshTokenResult result)
        {
            if (result.IsError)
            {
                if (result.Error == "invalid_grant")
                {
                    Reset();
                }
                return;
            }
            AccessToken = result.AccessToken;
            AccessTokenExpirationTime = DateTime.Now.AddSeconds(result.ExpiresIn);
            if (result.RefreshToken != null)
            {
                RefreshToken = result.RefreshToken;
            }
            if (result.IdentityToken != null)
            {
                IdToken = result.IdentityToken;
            }
            await UpdateRevocationEndpointAsync();

            forceTokenRefresh = false;
            UpdateHooks?.Invoke();
        }
Beispiel #2
0
        public async void Update(LoginResult result)
        {
            if (result.IsError)
            {
                Reset();
                return;
            }
            AccessToken = result.AccessToken;
            AccessTokenExpirationTime = result.AccessTokenExpiration;
            RefreshToken = result.RefreshToken;
            IdToken      = result.IdentityToken;
            Scope        = new List <string>(Client.Options.Scope.Split(" +".ToCharArray()));
            await UpdateRevocationEndpointAsync();

            forceTokenRefresh = false;
            UpdateHooks?.Invoke();
        }
Beispiel #3
0
 public void Reset()
 {
     InitializeState();
     UpdateHooks?.Invoke();
 }