/** * Check if a user is in a role. * * @param role name of role to check */ public boolean isUserInRole(String role) { return realm.isUserInRole(getUserPrincipal(), role); }
String username = persistentLoginManager.getRememberedUsername(request, response); String password = persistentLoginManager.getRememberedPassword(request, response); Principal principal = realm.authenticate(username, password); if (principal != null) { request.setUserPrincipal(principal); String username = request.getParameter(FORM_USERNAME); String password = request.getParameter(FORM_PASSWORD); Principal principal = realm.authenticate(username, password); if (principal != null) {
String username = parseUsername(decoded); String password = parsePassword(decoded); Principal principal = realm.authenticate(username, password); if (principal != null) {
if ("*".equals(role) || realm.isUserInRole(principal, role)) { authorized = true;