Search in sources :

Example 1 with ClearTrustAuthenticator

use of com.centurylink.mdw.auth.ClearTrustAuthenticator in project mdw-designer by CenturyLinkCloud.

the class WorkflowProject method getAuthenticator.

public Authenticator getAuthenticator() {
    if (isGitVcs() && isRemote()) {
        AppSummary appSummary = getRemoteAppSummary(true);
        if (appSummary == null)
            return null;
        String oauthTokenUrl = appSummary.getOAuthTokenUrl();
        if (oauthTokenUrl != null)
            return new OAuthAuthenticator(oauthTokenUrl);
        if ("mdw".equals(appSummary.getAuthMethod())) {
            try {
                return new MdwAuthenticator(appSummary.getAppId(), MdwPlugin.getSettings().getMdwCentralUrl() + "/services/com/centurylink/mdw/central/auth");
            } catch (Exception ex) {
                PluginMessages.uiError(ex, "Authentication", this);
            }
        }
    }
    // https://wiki.eclipse.org/Security:_KeyStore_support_for_Eclipse
    return new ClearTrustAuthenticator();
}
Also used : ClearTrustAuthenticator(com.centurylink.mdw.auth.ClearTrustAuthenticator) OAuthAuthenticator(com.centurylink.mdw.auth.OAuthAuthenticator) MdwAuthenticator(com.centurylink.mdw.designer.auth.MdwAuthenticator) AppSummary(com.centurylink.mdw.designer.model.AppSummary) CoreException(org.eclipse.core.runtime.CoreException) JSONException(org.json.JSONException) GeneralSecurityException(java.security.GeneralSecurityException) IOException(java.io.IOException) MdwSecurityException(com.centurylink.mdw.auth.MdwSecurityException) MalformedURLException(java.net.MalformedURLException)

Aggregations

ClearTrustAuthenticator (com.centurylink.mdw.auth.ClearTrustAuthenticator)1 MdwSecurityException (com.centurylink.mdw.auth.MdwSecurityException)1 OAuthAuthenticator (com.centurylink.mdw.auth.OAuthAuthenticator)1 MdwAuthenticator (com.centurylink.mdw.designer.auth.MdwAuthenticator)1 AppSummary (com.centurylink.mdw.designer.model.AppSummary)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 GeneralSecurityException (java.security.GeneralSecurityException)1 CoreException (org.eclipse.core.runtime.CoreException)1 JSONException (org.json.JSONException)1