def get_stored_credentials():
    """
        Gets the credentials, username and password, that have been stored in
        ~/.shrew/config.ini and the secure keychain respectively without bothering
        to prompt the user if either credential cannot be found.

        :returns: username and password
        :rtype: tuple of str
    """
    with load_config(sections=AUTH_SECTIONS, defaults=AUTH_CONFIG_DEFAULTS) as config:
        username = config.get(AUTH_SECTION, 'username')
        if not username:
            # if we don't have a username then we cannot lookup the password
            return None, None

    has_keychain = initialize_keychain()
    # Unlock the user's keychain otherwise, if running under SSH, 'security(1)' will thrown an error.
    unlock_keychain(username)

    if has_keychain:
        try:
            password = keyring.get_password(AUTH_SECTION, username)
            return username, password
        except Exception as e:
            log.warn("Unable to get password from keyring. Continuing..")
            log.debug(e)

    return username, None
Gets the credentials, username and password, that have been stored in
        ~/.shrew/config.ini and the secure keychain respectively without bothering
        to prompt the user if either credential cannot be found.

        :returns: username and password
        :rtype: tuple of str