/** * Retrieves the name to authenticate with. * * @return String the domain these credentials are intended to authenticate with. */ public String getDomain() { return this.principal.getDomain(); }
public String getUserName() { return this.principal.getUsername(); }
/** * Constructor. * @param userName The user name. This should not include the domain to authenticate with. * For example: "user" is correct whereas "DOMAIN\user" is not. * @param password The password. * @param workstation The netbios workstation name that the authentication request is originating from. * Essentially, the computer name for this machine. * @param domain The domain to authenticate within. * @param netbiosDomain The netbios version of the domain name. */ public NTCredentials( final String userName, final char[] password, final String workstation, final String domain, final String netbiosDomain) { super(); Args.notNull(userName, "User name"); this.principal = new NTUserPrincipal(domain, userName); this.password = password; if (workstation != null) { this.workstation = workstation.toUpperCase(Locale.ROOT); } else { this.workstation = null; } this.netbiosDomain = netbiosDomain; }