public NexusContentRestrictedToken(final UsernamePasswordToken basis, final ServletRequest request) { checkNotNull(basis); this.principal = basis.getPrincipal(); this.credentials = basis.getPassword(); //this.rememberMe = basis.isRememberMe(); this.host = basis.getHost(); this.request = checkNotNull(request); }
public NexusContentRestrictedToken(final UsernamePasswordToken basis, final ServletRequest request) { checkNotNull( basis ); this.principal = basis.getPrincipal(); this.credentials = basis.getPassword(); //this.rememberMe = basis.isRememberMe(); this.host = basis.getHost(); this.request = checkNotNull( request ); }
/** * Extracts the hostname if possible. If the supplied token is a <code>UsernamePasswordToken</code> * and the hostname field is not set, <code>DEFAULT_HOSTNAME</code> is returned. If the supplied * token is not a <code>UsernamePasswordToken</code> (i.e., a <code>CasToken</code> or other * implementation of <code>AuthenticationToken</code>), then <code>DEFAULT_HOSTNAME</code> is * returned. * * @param token An <code>AuthenticationToken</code>, possibly a <code>UsernamePasswordToken</code> * @return the hostname, or <code>DEFAULT_USERNAME</code> depending on input */ public static String extractHostname(final AuthenticationToken token) { if (isUsernamePasswordToken(token)) { final UsernamePasswordToken upt = (UsernamePasswordToken) token; return extractField(upt.getHost(), DEFAULT_HOSTNAME); } return DEFAULT_HOSTNAME; }
protected AuthenticationRequest createAuthenticationRequest(UsernamePasswordToken token) { String username = token.getUsername(); char[] password = token.getPassword(); String host = token.getHost(); DefaultUsernamePasswordRequest usernamePasswordRequest = new DefaultUsernamePasswordRequest(username, password); if (host != null) { usernamePasswordRequest.setHost(host); } return usernamePasswordRequest; }
protected AuthenticationRequest createAuthenticationRequest(UsernamePasswordToken token) { String username = token.getUsername(); char[] password = token.getPassword(); String host = token.getHost(); DefaultUsernamePasswordRequest usernamePasswordRequest = new DefaultUsernamePasswordRequest(username, password); if (host != null) { usernamePasswordRequest.setHost(host); } return usernamePasswordRequest; }