jaas/src/main/java/com/yubico/jaas/impl/YubikeyToUserMapImpl.java
public boolean is_right_user(String username, String publicId) {
		if (! this.verify_yubikey_owner) {
			log.debug("YubiKey owner verification disabled, returning 'true'");
			return true;
		}
		if (this.id2name_textfile == null) {
			log.debug("No id2name configuration. Defaulting to {}.", this.verify_yubikey_owner);
			return this.verify_yubikey_owner;
		}

		String ykuser;
		try {
			ykuser = get_username_for_id(publicId, this.id2name_textfile);
		} catch (FileNotFoundException ex) {
			log.error("Yubikey to username textfile {} not found", this.id2name_textfile);
			return false;
		}

		if (ykuser != null) {
			if (! ykuser.equals(username)) {
				log.info("YubiKey " + publicId + " registered to user {}, NOT {}", ykuser, username);
				return false;
			}
			return true;
		} else {
			if (this.auto_provision_owners) {
				log.info("Registering new YubiKey " + publicId + " as belonging to {}", username);

				add_yubikey_to_user(publicId, username, this.id2name_textfile);
				return true;
			}
			log.debug("No record of YubiKey {} found. Returning 'false'.", publicId);
			return false;
		}
	}
public boolean is_right_user(String username, String publicId) {
		if (! this.verify_yubikey_owner) {
			log.debug("YubiKey owner verification disabled, returning 'true'");
			return true;
		}
		if (this.id2name_textfile == null) {
			log.debug("No id2name configuration. Defaulting to {}.", this.verify_yubikey_owner);
			return this.verify_yubikey_owner;
		}

		String ykuser;
		try {
			ykuser = get_username_for_id(publicId, this.id2name_textfile);
		} catch (FileNotFoundException ex) {
			log.error("Yubikey to username textfile {} not found", this.id2name_textfile);
			return false;
		}

		if (ykuser != null) {
			if (! ykuser.equals(username)) {
				log.info("YubiKey " + publicId + " registered to user {}, NOT {}", ykuser, username);
				return false;
			}
			return true;
		} else {
			if (this.auto_provision_owners) {
				log.info("Registering new YubiKey " + publicId + " as belonging to {}", username);

				add_yubikey_to_user(publicId, username, this.id2name_textfile);
				return true;
			}
			log.debug("No record of YubiKey {} found. Returning 'false'.", publicId);
			return false;
		}
	}
public boolean is_right_user ( String username , String publicId ) { if ( ! this . verify_yubikey_owner ) { log . debug ( "YubiKey owner verification disabled, returning 'true'" ) ; return true ; } if ( this . id2name_textfile == null ) { log . debug ( "No id2name configuration. Defaulting to {}." , this . verify_yubikey_owner ) ; return this . verify_yubikey_owner ; } String ykuser ; try { ykuser = get_username_for_id ( publicId , this . id2name_textfile ) ; } catch ( FileNotFoundException ex ) { log . error ( "Yubikey to username textfile {} not found" , this . id2name_textfile ) ; return false ; } if ( ykuser != null ) { if ( ! ykuser . equals ( username ) ) { log . info ( "YubiKey " + publicId + " registered to user {}, NOT {}" , ykuser , username ) ; return false ; } return true ; } else { if ( this . auto_provision_owners ) { log . info ( "Registering new YubiKey " + publicId + " as belonging to {}" , username ) ; add_yubikey_to_user ( publicId , username , this . id2name_textfile ) ; return true ; } log . debug ( "No record of YubiKey {} found. Returning 'false'." , publicId ) ; return false ; } }
{@inheritDoc}
{