コード例 #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();
        }
コード例 #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();
        }
コード例 #3
0
 public void Reset()
 {
     InitializeState();
     UpdateHooks?.Invoke();
 }