- if (authorization == null) {
- // create credentials
- final String username = nameCallback.getName();
- if (username == null || username.trim().equals("")) {
- // authorization = userAdmin.getAuthorization(null);
- throw new CredentialNotFoundException(
- "No credentials provided");
- } else {
- char[] password = {};
- if (passwordCallback.getPassword() != null)
- password = passwordCallback.getPassword();
- else
- throw new CredentialNotFoundException(
- "No credentials provided");
-
- User user = userAdmin.getUser(null, username);
- if (user == null)
- throw new FailedLoginException("Invalid credentials");
- if (!user.hasCredential(null, password))
- throw new FailedLoginException("Invalid credentials");
- // return false;
-
- // Log and monitor new login
- if (log.isDebugEnabled())
- log.debug("Logged in to CMS with username [" + username+"]");
-
- authorization = userAdmin.getAuthorization(user);
- }
+ // authorization = (Authorization)
+ // sharedState.get(CmsAuthUtils.SHARED_STATE_AUTHORIZATION);
+ //
+ // if (authorization == null) {
+ // create credentials
+ username = nameCallback.getName();
+ if (username == null || username.trim().equals("")) {
+ // authorization = userAdmin.getAuthorization(null);
+ throw new CredentialNotFoundException("No credentials provided");