public String[] getRoleNames(SSOUser ssoUser, SSORole ssoRole) { String[] result = new String[1]; result[0] = ssoRole.getName(); return result; }
@Override public String getName() { return user.getName(); }
public String[] getRoleNames(SSOUser ssoUser, SSORole ssoRole) { SSOAction[] actions = ssoUser.getActionsMap().get(ssoRole); String[] result = new String[actions.length]; for (int i = 0; i < actions.length; i++) { result[i] = actions[i].getName(); } return result; }
/** * @see SSOService#updateUserDescription(UserDescription) */ @Override public void updateUserDescription(UserDescription user) throws UserNotFoundException, BadPublicKeyException { UserForDescription userForDescription = internalSSOService.getUserDescription(user.getUsername()); if (userForDescription == null) { throw new UserNotFoundException(user.getUsername()); } userForDescription.setEmail(user.getEmail()); userForDescription.setName(user.getFirstName()); userForDescription.setSurname(user.getLastName()); userForDescription.setSecretQuestion(user.getSecretQuestion()); userForDescription.setSecretAnswer(user.getSecretAnswer()); userForDescription.setPublicKey(user.getPublicKey()); userForDescription.setOrganization(user.getOrganization()); internalSSOService.updateUserForDescription(userForDescription); }
public SSOAction[] getActions() throws Exception { List<ActionDescription> descriptions = actionDescriptionCollector.collect(); SSOAction[] actions = new SSOAction[descriptions.size()]; for (int i = 0; i < descriptions.size(); i++) { actions[i] = new SSOAction(descriptions.get(i).getName(), false); } return actions; }
protected AuthenticationRequestInfo createAuthRequestInfo(HttpServletRequest request) { AuthenticationRequestInfo result = new AuthenticationRequestInfo(); result.setIpAddress(request.getRemoteAddr()); result.setSubsystemIdentifier(subsystemIdentifier); return result; }
/** * @see SSOService#resetPassword(com.payneteasy.superfly.api.PasswordReset) */ @Override public void resetPassword(PasswordReset reset) throws UserNotFoundException, PolicyValidationException { doResetPassword(reset.getUsername(), reset.getPassword(), reset.isSendByEmail()); }
/** * @see SSOService#authenticate(String, String, AuthenticationRequestInfo) */ @Override public SSOUser authenticate(String username, String password, AuthenticationRequestInfo authRequestInfo) { return internalSSOService.authenticate(username, password, obtainSubsystemIdentifier(authRequestInfo.getSubsystemIdentifier()), authRequestInfo.getIpAddress(), authRequestInfo.getSessionInfo()); }
protected SSOUser createSSOUser(String username) { return new SSOUser(username, getActionsMap(username), Collections.<String, String>emptyMap()); }
public Map<SSORole, SSOAction[]> build() throws Exception { Map<SSORole, SSOAction[]> map = new HashMap<SSORole, SSOAction[]>(); for (String roleName : roleNames) { SSORole role = new SSORole(roleName); SSOAction[] actions = actionsSource.getActions(); map.put(role, actions); } return map; }
protected SSOAction[] convertToSSOActions(List<AuthAction> authActions) { SSOAction[] actions = new SSOAction[authActions.size()]; for (int i = 0; i < authActions.size(); i++) { AuthAction authAction = authActions.get(i); SSOAction ssoAction = new SSOAction(authAction.getActionName(), authAction.isLogAction()); actions[i] = ssoAction; } return actions; }
public void apply(PasswordCheckContext aContext) throws PolicyValidationException { if(aContext.getPassword()==null) throw new PolicyValidationException(PolicyValidationException.EMPTY_PASSWORD); if(aContext.getPassword().length()<theMaxPasswordLen) throw new PolicyValidationException(PolicyValidationException.SHORT_PASSWORD); }
@Override protected SSOUser doAuthenticate( UsernamePasswordAuthRequestInfoAuthenticationToken authRequest, String username, String password) { SSOUser ssoUser = ssoService.authenticate(username, password, authRequest.getAuthRequestInfo()); return ssoUser; } }
protected void sendNoPublicKey(String subsystemIdentifier, String email) throws MessageSendException { try { emailService.sendNoPublicKeyMessage(subsystemIdentifier, email); } catch (RuntimeMessagingException e) { logger.error("Could not send a message to " + email, e); throw new MessageSendException(e); } }
public void send() { try { final ActionDescription[] actionDescriptions = obtainActionDescriptions(); if (logger.isDebugEnabled()) { logger.debug("Sending the following actions: {}", getActionsStringForLog(actionDescriptions)); } ssoService.sendSystemData(getSubsystemIdentifier(), actionDescriptions); } catch (CollectionException e) { logger.error("Cannot send subsystem data", e); } }
protected SSOUserWithActions convertToSSOUser(UserWithActions user) { return new SSOUserWithActions(user.getUsername(), user.getEmail(), convertToSSOActions(user.getActions())); }
protected AuthenticationRequestInfo createAuthRequestInfo(HttpServletRequest request) { AuthenticationRequestInfo result = new AuthenticationRequestInfo(); result.setIpAddress(request.getRemoteAddr()); result.setSubsystemIdentifier(subsystemIdentifier); return result; }
@Override public String getName() { return getSsoUser().getName(); }
public void apply(PasswordCheckContext aContext) throws PolicyValidationException { if (aContext.isPasswordExist(aContext.getPassword(), theHistoryLength)) throw new PolicyValidationException(PolicyValidationException.EXISTING_PASSWORD); }