Get the username and password to use for the given uri.
@see org.eclipse.jgit.transport.CredentialsProvider#get(org.eclipse.jgit.transport.URIish,
org.eclipse.jgit.transport.CredentialItem[])
9204
@Override
	public boolean get(URIish uri, CredentialItem... items)
			throws UnsupportedCredentialItem {
		String codeCommitPassword;
		String awsAccessKey;
		String awsSecretKey;
		try {
			AWSCredentials awsCredentials = retrieveAwsCredentials();
			StringBuilder awsKey = new StringBuilder();
			awsKey.append(awsCredentials.getAWSAccessKeyId());
			awsSecretKey = awsCredentials.getAWSSecretKey();
			if (awsCredentials instanceof AWSSessionCredentials) {
				AWSSessionCredentials sessionCreds = (AWSSessionCredentials) awsCredentials;
				if (sessionCreds.getSessionToken() != null) {
					awsKey.append('%').append(sessionCreds.getSessionToken());
				}
			}
			awsAccessKey = awsKey.toString();
		}
		catch (Throwable t) {
			this.logger.warn("Unable to retrieve AWS Credentials", t);
			return false;
		}
		try {
			codeCommitPassword = calculateCodeCommitPassword(uri, awsSecretKey);
		}
		catch (Throwable t) {
			this.logger.warn("Error calculating the AWS CodeCommit password", t);
			return false;
		}

		for (CredentialItem i : items) {
			if (i instanceof CredentialItem.Username) {
				((CredentialItem.Username) i).setValue(awsAccessKey);
				this.logger.trace("Returning username " + awsAccessKey);
				continue;
			}
			if (i instanceof CredentialItem.Password) {
				((CredentialItem.Password) i).setValue(codeCommitPassword.toCharArray());
				this.logger.trace("Returning password " + codeCommitPassword);
				continue;
			}
			if (i instanceof CredentialItem.StringType
					&& i.getPromptText().equals("Password: ")) { //$NON-NLS-1$
				((CredentialItem.StringType) i).setValue(codeCommitPassword);
				this.logger.trace("Returning password string " + codeCommitPassword);
				continue;
			}
			throw new UnsupportedCredentialItem(uri,
					i.getClass().getName() + ":" + i.getPromptText()); //$NON-NLS-1$
		}

		return true;
	}
1345432
public User getUser(String name, String password) {

        if (name == null) {
            name = "";
        }

        if (password == null) {
            password = "";
        }

        User user = get(name);

        user.checkPassword(password);

        return user;
    }
603323
private static CredentialProvider getCredentialProvider(TextDevice textDevice) throws IOException {
        String providerPath = textDevice.readLine("Please enter the full path to the credential provider:");

        if (providerPath != null) {
            Configuration conf = new Configuration(false);
            conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, providerPath);
            return CredentialProviderFactory.getProviders(conf).get(0);
        }

        return null;
    }
640679
public OvhCredential api_credential_credentialId_GET(Long credentialId) throws IOException {
		String qPath = "/me/api/credential/{credentialId}";
		StringBuilder sb = path(qPath, credentialId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhCredential.class);
	}
1345821
protected Xdr getCredential() {
        Xdr credentials = new Xdr(_maximumXdrBytes);
        credentials.setOffset(0);
        credentials.putInt((int) (System.currentTimeMillis() / 1000));
        credentials.putString(_host);
        credentials.putInt(_uid);
        credentials.putInt(_gid);
        if (_gids == null) {
            credentials.putInt(0);
        } else {
            credentials.putInt(_gids.length);
            for (int i = 0; i < _gids.length; i++)
                credentials.putInt(_gids[i]);
        }
        return credentials;
    }
511317
def _get_credentials(self):
        
        uri = URITemplate(self.baseuri + '/{username}/credentials').expand(
            username=self.username)

        resp = self.session.post(uri)

        self.handle_http_error(
            resp,
            custom_messages={
                401: "Token is not authorized",
                404: "Token does not have upload scope",
                429: "Too many requests"})
        return resp
775319
private String getPasswordOnRecord(final String username) throws IOException {
        try (val stream = Files.lines(fileName.getFile().toPath())) {
            return stream.map(line -> line.split(this.separator))
                .filter(lineFields -> {
                    val userOnRecord = lineFields[0];
                    return username.equals(userOnRecord);
                })
                .map(lineFields -> lineFields[1])
                .findFirst()
                .orElse(null);
        }
    }
708316
protected Credential getCredential(HttpServletRequest req) {
    Credential cred = (Credential) req.getAttribute(AUTH_CREDENTIAL);
    return cred;
  }
190957
public Credentials getCredentials() {
        String username = getUsername();
        char[] password = getPassword();
        if (username != null) {
            return new SimpleCredentials(username, password);
        }
        return null;
    }
757119
@Override
	public String[] getRoles(String username) {
		if (user_list.containsKey(username)) {
			return user_list.get(username).toArray(new String[0]);
		} else {
			if (defaultRoles == null) {
				return new String[0];
			} else {
				return defaultRoles;
			}
		}
	}
366169
public User get(String loginname, String password) {
        Connection conn = null;
        User user = null;
        if (loginname == null || password == null) return null;
        String cryptpassword = MD5.encodeString(password,null);
        try {
            conn = ConnectionUtils.getConnection();
            user = userDAO.get(conn,loginname,cryptpassword);
        } catch(SQLException e) {
            logger.error(e.getMessage());
        } finally {
            DbUtils.closeQuietly(conn);
        }
        return user;
    }
144018
def get(cls, credential_password_ip_id, permitted_ip_id,
            custom_headers=None):
        

        if custom_headers is None:
            custom_headers = {}

        api_client = client.ApiClient(cls._get_api_context())
        endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
                                                     credential_password_ip_id,
                                                     permitted_ip_id)
        response_raw = api_client.get(endpoint_url, {}, custom_headers)

        return BunqResponsePermittedIp.cast_from_bunq_response(
            cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
        )
187365
protected IPromise<BasicAuthenticationResult> getCredentials(String user, String pw, String jwt) {
        Promise p = new Promise();
        if ( SESSIONID_SPECIAL_STRING.equals(pw) ) {
            sessionStorage.getUserFromSessionId(user).then( (r,e) -> {
                if ( r != null ) {
                    sessionStorage.getUser(r).then( (rec,err) -> {
                        if ( rec != null )
                            getCredentials(rec.getKey(),rec.getString("pwd"), null ).then(p);
                        else
                            p.reject("unknown user");
                    });
                } else {
                    p.reject("authentication failed");
                }
            });
        } else {
            sessionStorage.getUser(user).then((rec, err) -> {
                if (rec == null) {
                    p.reject("wrong user or password");
                } else {
                    if (pw.equals(rec.getString("pwd"))) {
                        if (!rec.getBool("verified")) {
                            // e.g. email verification etc.
                            p.reject("account not verified");
                        } else
                            p.resolve(new BasicAuthenticationResult().userName(rec.getKey()));
                    }
                }
            });
        }
        return p;
    }
785201
@Override public TopLevelItem getItem(String name) throws AccessDeniedException {
        if (name==null)    return null;
        TopLevelItem item = items.get(name);
        if (item==null)
            return null;
        if (!item.hasPermission(Item.READ)) {
            if (item.hasPermission(Item.DISCOVER)) {
                throw new AccessDeniedException("Please login to access job " + name);
            }
            return null;
        }
        return item;
    }
218363
@Override
  public final UserCredentials retrieveUserCredentials(
    final String pUserName) throws Exception {
    String query = "select USERTOMCAT.ITSUSER as ITSUSER, ITSPASSWORD, ITSROLE"
      + " from USERTOMCAT join USERROLETOMCAT on USERROLETOMCAT.ITSUSER ="
        + " USERTOMCAT.ITSUSER where USERTOMCAT.ITSUSER = '" + pUserName + "';";
    UserCredentials result = null;
    IRecordSet<RS> recordSet = null;
    try {
      this.srvDatabase.setIsAutocommit(false);
      this.srvDatabase.
        setTransactionIsolation(ISrvDatabase.TRANSACTION_READ_UNCOMMITTED);
      this.srvDatabase.beginTransaction();
      recordSet = getSrvDatabase().retrieveRecords(query);
      if (recordSet.moveToFirst()) {
        ArrayList<String> roles = new ArrayList<String>();
        do {
          if (result == null) {
            result = new UserCredentials();
            result.setUserName(recordSet.getString("ITSUSER"));
            result.setUserPassword(recordSet.getString("ITSPASSWORD"));
          }
          roles.add(recordSet.getString("ITSROLE"));
        } while (recordSet.moveToNext());
        result.setUserRoles(roles.toArray(new String[roles.size()]));
      }
      this.srvDatabase.commitTransaction();
    } catch (Exception ex) {
      this.srvDatabase.rollBackTransaction();
      throw ex;
    } finally {
      this.srvDatabase.releaseResources();
      if (recordSet != null) {
        recordSet.close();
      }
    }
    return result;
  }
381252
public OvhRegistryCredentials serviceName_registry_credentials_credentialsId_GET(String serviceName, String credentialsId) throws IOException {
		String qPath = "/caas/containers/{serviceName}/registry/credentials/{credentialsId}";
		StringBuilder sb = path(qPath, serviceName, credentialsId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhRegistryCredentials.class);
	}
694078
def get_credentials(options, environment):
    
    if options['--username'] or options['--auth']:
        if not options['--username']:
            options['<username>'] = lib.prompt("Please enter the username for %s..." % environment)
        if not options['--password']:
            options['<password>'] = lib.prompt("Please enter the password for %s..." % environment, secret=True)
    return options