Пример #1
0
        public AuthenticationViewModel(IJiraToolWindowNavigatorViewModel parent,
                                       IOAuthService oAuthService,
                                       IBasicAuthenticationService basicService,
                                       IUserService userService)
        {
            this._parent = parent;

            this._baseUrl      = UserSettingsHelper.ReadStringFromUserSettings("JiraBaseUrl");
            this._baseUrlBasic = UserSettingsHelper.ReadStringFromUserSettings("JiraBaseUrl");
            this._username     = UserSettingsHelper.ReadStringFromUserSettings("JiraUsername");

            this._oAuthService = oAuthService;
            this._basicService = basicService;
            this._userService  = userService;

            SettingsManager settingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider);

            this._userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

            this.SignInOAuthCommand     = new DelegateCommand(SignInOAuth);
            this.SignInBasicCommand     = new DelegateCommand(SignInBasic);
            this.HowToSetupOAuthCommand = new DelegateCommand(HowToSetupOAuth);

            SetPanelTitles();
        }
Пример #2
0
 public LoginViewModel(
     INavigationService navigationService,
     IBasicAuthenticationService basicAuthenticationService)
 {
     _navigationService          = navigationService ?? throw new ArgumentNullException(nameof(navigationService));
     _basicAuthenticationService = basicAuthenticationService ?? throw new ArgumentNullException(nameof(basicAuthenticationService));
     LoginCommand = new Command(async() => await Login());
 }
Пример #3
0
 public BasicAuthenticationHandler(
     IOptionsMonitor <AuthenticationSchemeOptions> options,
     ILoggerFactory logger,
     UrlEncoder encoder,
     ISystemClock clock,
     IBasicAuthenticationService basicAuthenticationService) : base(options, logger, encoder, clock)
 {
     _basicAuthenticationService = basicAuthenticationService;
 }
Пример #4
0
        public AuthenticationView(JiraToolWindowNavigatorViewModel parent,
                                  IOAuthService oAuthService,
                                  IBasicAuthenticationService basicService,
                                  IUserService userService)
        {
            InitializeComponent();

            this._viewModel  = new AuthenticationViewModel(parent, oAuthService, basicService, userService);
            this.DataContext = this._viewModel;
        }
        public JiraToolWindowNavigatorViewModel(ToolWindowPane parent)
        {
            this._parent = (JiraToolWindow)parent;

            this._searchHost = parent.SearchHost;

            this._historyNavigator = new HistoryNavigator();

            this._service = JiraPackage.Mcs;

            this._oAuthService = new OAuthService();
            this._basicAuthenticationService = new BasicAuthenticationService();

            InitializeCommands(this._service);
        }
Пример #6
0
        public ConnectionViewModel(IJiraToolWindowNavigatorViewModel parent, IUserService userService, IBasicAuthenticationService basicAuthenticationService)
        {
            this._parent = parent;

            this._userService = userService;
            this._basicAuthenticationService = basicAuthenticationService;

            this.GetAuthenticatedUserAsync();

            SettingsManager settingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider);

            this._userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

            this.SignOutCommand           = new DelegateCommand(SignOut);
            this.IssueReportGitHubCommand = new DelegateCommand(IssueReportGitHub);

            SetPanelTitles();
        }
 public AccountsController(BasicAuthenticationHandler authenticationHandler,
                           IBasicAuthenticationService authenticationService)
 {
     _authenticationService = authenticationService;
     _authenticationHandler = authenticationHandler;
 }