Exemple #1
0
 public JirnalCore()
 {
     oauthSettings_  = new OAuthSettings();
     ProjectSettings = new ProjectSettings();
     jiraProxy_      = new JiraProxy(oauthSettings_.BaseUrl);
     JiraOAuthClient = new JiraOAuthClient(oauthSettings_.BaseUrl, oauthSettings_.ConsumerKey, oauthSettings_.ConsumerSecret);
     MessageBus      = new MessageBus();
 }
Exemple #2
0
        public async Task <(bool, string)> Authenticate()
        {
            if (oauthSettings_.AccessToken.IsNullOrWhitespace())
            {
                return(false, "No OAuth credentials");
            }

            jiraProxy_.LoadOAuthAuthenticator(oauthSettings_);
            var profile = await jiraProxy_.GetProfile();

            if (profile == null)
            {
                return(false, "Could not verify login");
            }

            isAuthenticated_  = true;
            JiraCache.Profile = profile;
            JiraCache.JiraFieldLookup.AddFields(await JiraProxy.GetAllFields());
            return(isAuthenticated_, "");
        }