/** * Creates a new authentication request. * * @param id that identifies the user * @param c credential to authenticate the user */ public AuthenticationRequest(final String id, final Credential c) { setUser(new User(id)); setCredential(c); }
/** * Creates a new authentication request. * * @param id that identifies the user * @param c credential to authenticate the user */ public AuthenticationRequest(final String id, final Credential c) { setUser(new User(id)); setCredential(c); }
/** * Creates a new authentication request. * * @param id that identifies the user * @param c credential to authenticate the user * @param attrs attributes to return */ public AuthenticationRequest(final String id, final Credential c, final String... attrs) { setUser(new User(id)); setCredential(c); setReturnAttributes(attrs); }
final String loginDn = auth.resolveDn(new User(nameCb.getName())); if (loginDn == null && noResultsIsError) { loginSuccess = false;
/** * Creates a new authentication request. * * @param id that identifies the user * @param c credential to authenticate the user * @param attrs attributes to return */ public AuthenticationRequest(final String id, final Credential c, final String... attrs) { setUser(new User(id)); setCredential(c); setReturnAttributes(attrs); }
final String loginDn = auth.resolveDn(new User(nameCb.getName())); if (loginDn == null && noResultsIsError) { loginSuccess = false;
authRequest.setUser(new User(nameCb.getName())); authRequest.setCredential(new Credential(passCb.getPassword()));
authRequest.setUser(new User(nameCb.getName())); authRequest.setCredential(new Credential(passCb.getPassword()));
/** * Initialize an authentication request with command line options. * * @param line parsed command line arguments * * @return authentication request that has been initialized */ protected AuthenticationRequest initAuthenticationRequest(final CommandLine line) { final AuthenticationRequest request = new AuthenticationRequest(); final AuthenticationRequestPropertySource arSource = new AuthenticationRequestPropertySource( request, getPropertiesFromOptions(PropertyDomain.AUTH.value(), line)); arSource.initialize(); if (request.getUser() == null) { // prompt for a user name final String user = System.console().readLine("[Enter user name]: "); request.setUser(new User(user)); } if (request.getCredential() == null) { // prompt the user to enter a password final char[] pass = System.console().readPassword("[Enter password for %s]: ", request.getUser()); request.setCredential(new Credential(pass)); } return request; }
/** * Initialize an authentication request with command line options. * * @param line parsed command line arguments * * @return authentication request that has been initialized */ protected AuthenticationRequest initAuthenticationRequest(final CommandLine line) { final AuthenticationRequest request = new AuthenticationRequest(); final AuthenticationRequestPropertySource arSource = new AuthenticationRequestPropertySource( request, getPropertiesFromOptions(PropertyDomain.AUTH.value(), line)); arSource.initialize(); if (request.getUser() == null) { // prompt for a user name final String user = System.console().readLine("[Enter user name]: "); request.setUser(new User(user)); } if (request.getCredential() == null) { // prompt the user to enter a password final char[] pass = System.console().readPassword("[Enter password for %s]: ", request.getUser()); request.setCredential(new Credential(pass)); } return request; }
context.put("usernamePasswordContext", getUsernamePasswordContext()); final AuthenticationRequest request = new AuthenticationRequest(new User(getUsernamePasswordContext().getUsername(), context), new Credential(getUsernamePasswordContext().getPassword()), returnAttributes); response = authenticator.authenticate(request);