/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(String userName, String password) { super(); if (userName == null) { throw new IllegalArgumentException("Username may not be null"); } this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * The constructor with the username and password combined string argument. * * @param usernamePassword the username:password formed string * @see #toString */ public UsernamePasswordCredentials(String usernamePassword) { super(); if (usernamePassword == null) { throw new IllegalArgumentException("Username:password string may not be null"); } int atColon = usernamePassword.indexOf(':'); if (atColon >= 0) { this.principal = new BasicUserPrincipal(usernamePassword.substring(0, atColon)); this.password = usernamePassword.substring(atColon + 1); } else { this.principal = new BasicUserPrincipal(usernamePassword); this.password = null; } }
public void setPrincipal( String userName ) { if (userName == null) { principal = null; } principal = new BasicUserPrincipal( userName ); }
@Override public Principal getUserPrincipal() { return new BasicUserPrincipal(login); }
@Override public Principal getUserPrincipal() { return new BasicUserPrincipal(login); }
@Override public Principal getUserPrincipal() { return new BasicUserPrincipal(identity); }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(String userName, String password) { super(); if (userName == null) { throw new IllegalArgumentException("Username may not be null"); } this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(String userName, String password) { super(); if (userName == null) { throw new IllegalArgumentException("Username may not be null"); } this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(String userName, String password) { super(); if (userName == null) { throw new IllegalArgumentException("Username may not be null"); } this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(String userName, String password) { super(); if (userName == null) { throw new IllegalArgumentException("Username may not be null"); } this.principal = new BasicUserPrincipal(userName); this.password = password; }
public void setPrincipal(String userName) { if (userName == null) { principal = null; } principal = new BasicUserPrincipal(userName); }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(final String userName, final String password) { super(); Args.notNull(userName, "Username"); this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(final String userName, final String password) { super(); Args.notNull(userName, "Username"); this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(final String userName, final String password) { super(); Args.notNull(userName, "Username"); this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(final String userName, final String password) { super(); Args.notNull(userName, "Username"); this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(final String userName, final String password) { super(); Args.notNull(userName, "Username"); this.principal = new BasicUserPrincipal(userName); this.password = password; }
@Override public Principal getUserPrincipal() { return new BasicUserPrincipal(authProvider.getUser()); }
/** * The constructor with the username and password arguments. * * @param userName the user name * @param password the password */ public UsernamePasswordCredentials(final String userName, final String password) { super(); Args.notNull(userName, "Username"); this.principal = new BasicUserPrincipal(userName); this.password = password; }
/** * Returns this instance as a Jetty UserIdentity. The returned instance is immutable and cached. */ public UserIdentity toUserIdentity() { if (_userIdentity == null) { String[] roles = _roles.toArray(new String[_roles.size()]); _userIdentity = new DefaultUserIdentity( new javax.security.auth.Subject(true, ImmutableSet.of(this), ImmutableSet.of(), ImmutableSet.of()), new BasicUserPrincipal(getId()), roles); } return _userIdentity; }
/** * @param servletUsername username returned from servlet container authentication * @param servletRoleNames roles returned from servlet container authentication */ public ContainerAuthToken(final String servletUsername, final Set<String> servletRoleNames) { servletUser = new BasicUserPrincipal(servletUsername); log.debug("Setting servlet username {}", servletUsername); this.servletRoles = new HashSet<>(); for (String roleName : servletRoleNames) { log.debug("Adding servlet role {} to {}", roleName, servletUsername); this.servletRoles.add(new ContainerRolesPrincipal(roleName)); } }