@Test public void testUserLoginIsCaseInsensitive2() throws Exception { createTestUser(); try (ContentSession cs = login(new SimpleCredentials(USER_ID_CASED, USER_PW.toCharArray()))) { AuthInfo authInfo = cs.getAuthInfo(); assertEquals(user.getID(), authInfo.getUserID()); assertTrue(USER_ID_CASED.equalsIgnoreCase(authInfo.getUserID())); } }
@Override public boolean login() throws LoginException { credentials = getCredentials(); PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin(); String loginName = getLoginId(preAuthLogin); Authentication authentication = getUserAuthentication(loginName); if (authentication != null) { if (preAuthLogin != null) { success = authentication.authenticate(PreAuthenticatedLogin.PRE_AUTHENTICATED); } else { success = authentication.authenticate(credentials); } if (success) { log.debug("Adding Credentials to shared state."); sharedState.put(SHARED_KEY_CREDENTIALS, credentials); log.debug("Adding login name to shared state."); sharedState.put(SHARED_KEY_LOGIN_NAME, loginName); userId = authentication.getUserId(); if (userId == null) { userId = loginName; } principal = authentication.getUserPrincipal(); } } else { credentials = null; userId = null; } return success; }
LoginModuleImpl extends AbstractLoginModule { @Override public boolean login() throws LoginException { credentials = getCredentials(); PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin(); String loginName = getLoginId(preAuthLogin); Authentication authentication = getUserAuthentication(loginName); if (authentication != null) { if (preAuthLogin != null) { success = authentication.authenticate(PreAuthenticatedLogin.PRE_AUTHENTICATED); } else { success = authentication.authenticate(credentials); } if (success) { log.debug("Adding Credentials to shared state."); sharedState.put(SHARED_KEY_CREDENTIALS, credentials); log.debug("Adding login name to shared state."); sharedState.put(SHARED_KEY_LOGIN_NAME, loginName); userId = authentication.getUserId(); if (userId == null) { userId = loginName; } principal = authentication.getUserPrincipal(); } } else { credentials = null; userId = null; } return success; } }
LoginModuleImpl extends AbstractLoginModule { @Override public boolean login() throws LoginException { credentials = getCredentials(); PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin(); String loginName = getLoginId(preAuthLogin); Authentication authentication = getUserAuthentication(loginName); if (authentication != null) { if (preAuthLogin != null) { success = authentication.authenticate(PreAuthenticatedLogin.PRE_AUTHENTICATED); } else { success = authentication.authenticate(credentials); } if (success) { log.debug("Adding Credentials to shared state."); sharedState.put(SHARED_KEY_CREDENTIALS, credentials); log.debug("Adding login name to shared state."); sharedState.put(SHARED_KEY_LOGIN_NAME, loginName); userId = authentication.getUserId(); if (userId == null) { userId = loginName; } principal = authentication.getUserPrincipal(); } } else { credentials = null; userId = null; } return success; }  }
LoginModuleImpl extends AbstractLoginModule { @Override public boolean login() throws LoginException { credentials = getCredentials(); PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin(); String loginName = getLoginId(preAuthLogin); Authentication authentication = getUserAuthentication(loginName); if (authentication != null) { if (preAuthLogin != null) { success = authentication.authenticate(PreAuthenticatedLogin.PRE_AUTHENTICATED); } else { success = authentication.authenticate(credentials); } if (success) { log.debug("Adding Credentials to shared state."); sharedState.put(SHARED_KEY_CREDENTIALS, credentials); log.debug("Adding login name to shared state."); sharedState.put(SHARED_KEY_LOGIN_NAME, loginName); userId = authentication.getUserId(); if (userId == null) { userId = loginName; } principal = authentication.getUserPrincipal(); } } else { credentials = null; userId = null; } return success; }  @Override boolean login(); @Override boolean commit(); @Override boolean logout(); }
LoginModuleImpl extends AbstractLoginModule { @Override public boolean login() throws LoginException { credentials = getCredentials(); PreAuthenticatedLogin preAuthLogin = getSharedPreAuthLogin(); String loginName = getLoginId(preAuthLogin); Authentication authentication = getUserAuthentication(loginName); if (authentication != null) { if (preAuthLogin != null) { success = authentication.authenticate(PreAuthenticatedLogin.PRE_AUTHENTICATED); } else { success = authentication.authenticate(credentials); } if (success) { log.debug("Adding Credentials to shared state."); sharedState.put(SHARED_KEY_CREDENTIALS, credentials); log.debug("Adding login name to shared state."); sharedState.put(SHARED_KEY_LOGIN_NAME, loginName); userId = authentication.getUserId(); if (userId == null) { userId = loginName; } principal = authentication.getUserPrincipal(); } } else { credentials = null; userId = null; } return success; }  @Override boolean login(); @Override boolean commit(); @Override boolean logout();  }