Пример #1
0
        protected BaseAuthService(IAuthDataService dataService)
        {
            _dataService = dataService;
            var key = ConfigurationManager.AppSettings["dataProtectorKey"] ?? DefaultKey;

            _dataProtector = new AesDataProtector(key);
        }
Пример #2
0
        public ExternalAuthService(IAuthDataService dataService, ILogger logger)
        {
            _dataService = dataService;
            _logger      = logger;
            var key = ConfigurationManager.AppSettings["dataProtectorKey"] ?? DefaultKey;

            _dataProtector = new AesDataProtector(key);
        }
Пример #3
0
 public LoginViewModel(
     IMvxMessenger messenger,
     IWebNavigation webNavigation,
     IAppVersionService appVersionService,
     IRefreshDataService refreshDataService,
     IAuthDataService authDataService,
     IPlatformStyleProvider platformStyleProvider,
     ICredentialsDataService credentialsDataService)
     : base(messenger, webNavigation, appVersionService, refreshDataService, authDataService, platformStyleProvider, credentialsDataService)
 {
 }
 public ProfilesViewModel(
     IMvxMessenger messenger,
     IPlatformStyleProvider platformStyleProvider,
     IRefreshDataService refreshDataService,
     IStudentDataService studentDataService,
     IAuthDataService authDataService)
 {
     this._messenger             = messenger;
     this._platformStyleProvider = platformStyleProvider;
     this._refreshDataService    = refreshDataService;
     this._studentDataService    = studentDataService;
     this._authDataService       = authDataService;
 }
        public override void HandleError(ServerUnreachableException exception)
        {
            IAuthDataService    authDataService    = (IAuthDataService)Mvx.get_IoCProvider().Resolve <IAuthDataService>();
            IProfileDataService profileDataService = (IProfileDataService)Mvx.get_IoCProvider().Resolve <IProfileDataService>();
            M0 m0 = Mvx.get_IoCProvider().Resolve <IConnectivity>();
            ICredentialsDataService credentialsDataService = (ICredentialsDataService)Mvx.get_IoCProvider().Resolve <ICredentialsDataService>();

            if (((IConnectivity)m0).get_IsConnected())
            {
                Profile profile = profileDataService.GetActiveProfile();
                try
                {
                    if (profile == null)
                    {
                        this.DisplayServerUnreachableErrorMessage(exception);
                    }
                    else
                    {
                        Credentials credentials = credentialsDataService.GetCredentials(profile?.Id);
                        if (credentials != null)
                        {
                            Task.Run <Profile>((Func <Task <Profile> >)(() => authDataService.Login(profile.Institute, credentials.UserName, credentials.Password))).Wait();
                        }
                        else
                        {
                            Task.Run <TokenData>((Func <Task <TokenData> >)(() => authDataService.RefreshToken(profile))).Wait();
                        }
                    }
                }
                catch (AggregateException ex)
                {
                    foreach (Exception innerException in ex.Flatten().InnerExceptions)
                    {
                        if (innerException is ServerUnreachableException exception1)
                        {
                            this.DisplayServerUnreachableErrorMessage(exception1);
                            ErrorHandler.Current.HandleError((Exception) new RefreshTokenException("Sikertelen relogin vagy token refresh", profile).SetErrorCode <RefreshTokenException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/Helpers/ErrorHandlers/ServerUnreachableErrorHandler.cs", 58));
                        }
                        else
                        {
                            ErrorHandler.Current.HandleError(innerException);
                        }
                    }
                }
            }
            else
            {
                ErrorHandler.Current.HandleError((Exception) new NoInternetConnectionException().SetErrorCode <NoInternetConnectionException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/Helpers/ErrorHandlers/ServerUnreachableErrorHandler.cs", 69));
            }
        }
Пример #6
0
 public NewProfileViewModel(
     IMvxMessenger messenger,
     IWebNavigation webNavigation,
     IAppVersionService appVersionService,
     IRefreshDataService refreshDataService,
     IAuthDataService authDataService,
     IPlatformStyleProvider platformStyleProvider,
     ICredentialsDataService credentialsDataService)
 {
     this._messenger              = messenger;
     this._webNavigation          = webNavigation;
     this._appVersionService      = appVersionService;
     this._refreshDataService     = refreshDataService;
     this._platformStyleProvider  = platformStyleProvider;
     this._credentialsDataService = credentialsDataService;
     this._authDataService        = authDataService;
 }
Пример #7
0
 public AuthorizationController(IAuthDataService authDataService)
 {
     _authDataService = authDataService;
 }
Пример #8
0
 public HomeController(IAuthDataService authDataService)
 {
     _authDataService = authDataService;
 }
 public AuthService(IAuthDataService authDataService)
 {
     _authDataService = authDataService;
 }
 public RegisterController(IAuthDataService authDataService)
 {
     _authDataService = authDataService;
 }
Пример #11
0
 public UserController(IAuthDataService authDataService)
 {
     _authDataService = authDataService;
 }
 public AuthorizationController(IAuthDataService authDataService, IProfileDataService profileDataService)
 {
     _authDataService = authDataService;
     _profileDataService = profileDataService;
 }