Exemplo n.º 1
0
        private void Auth_Completed(object sender, AuthenticatorCompletedEventArgs e)
        {
            try
            {
                if (e.IsAuthenticated)
                {
                    AkHelper.TokenType         = e.Account.Properties["token_type"];
                    AkHelper.ClientAccessToken = e.Account.Properties["access_token"];

                    _authenticatorService.OnAuthenticateCompleted(AkHelper.TokenType, AkHelper.ClientAccessToken);

                    _isUserAuthenticated = true;
                    RaisePropertyChanged(nameof(IsUserAuthenticated));
                }
                else
                {
                    _authenticatorService.OnAuthenticateFailed();

                    _isUserAuthenticated = false;
                    RaisePropertyChanged(nameof(IsUserAuthenticated));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }