@Override public String getKeyName() { return credential.getId(); }
this.credentialsId = credentials != null ? credentials.getId() : null; this.supportsWikiStyleComment = supportsWikiStyleComment; this.recordScmChanges = recordScmChanges;
public static StandardUsernamePasswordCredentials getCredentials(String credentialsId, Job<?,?> owner) { if (credentialsId != null) { for (StandardUsernamePasswordCredentials c : CredentialsProvider.lookupCredentials( StandardUsernamePasswordCredentials.class, owner, null, URIRequirementBuilder.fromUri(BitbucketApi.OAUTH_ENDPOINT).build())) { if (c.getId().equals(credentialsId)) { return c; } } } return null; } }
protected Object readResolve() { if (StringUtils.isNotBlank(collectionUrl) && password != null && StringUtils.isNotBlank(password.getPlainText())) { try { final URI uri = new URI(collectionUrl); String hostName = uri.getHost(); List<StandardUsernamePasswordCredentials> credentials = TeamCollectionConfiguration.findCredentials(hostName); for (StandardUsernamePasswordCredentials credential : credentials) { if ((StringUtils.isBlank(username) || credential.getUsername().equals(username)) && credential.getPassword().getPlainText().equals(password.getPlainText())) { this.credentialsId = credential.getId(); return this; } } this.credentialsId = TeamCollectionConfiguration.setCredentials(hostName, username, password.getPlainText()); } catch (Exception ex) { logger.log(Level.WARNING, String.format("Get or generate credentials for collection url: %s and username: %s failed.", collectionUrl, username), ex); } } return this; }
LOGGER.log(Level.FINE, "Maven Server ID {0}: use {1} / {2}", new Object[]{mavenServerId, usernamePasswordCredentials.getId(), usernamePasswordCredentials.getDescription()});
try { SystemCredentialsProvider.getInstance().save(); LOGGER.log(Level.INFO, "Provided username and password were successfully migrated and stored as {0}", newCredentials.getId()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Unable to store migrated credentials", e);
username, user.getId()); tried = true; .error("Failed to authenticate as %s. Wrong password. " + "(credentialId:%s/method:keyboard-interactive)", username, user.getId()); tried = true; e.printStackTrace(getListener() .error("Unexpected error while trying to authenticate as %s with credential=%s", username, user.getId()));