@Override protected SSOUser doAuthenticate( UsernamePasswordAuthRequestInfoAuthenticationToken authRequest, String username, String password) { SSOUser ssoUser = ssoService.authenticate(username, password, authRequest.getAuthRequestInfo()); return ssoUser; } }
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); } }
@Override public void run() { Set<Long> sessionIds = new HashSet<Long>(); Long sessionId; do { sessionId = queue.poll(); if (sessionId != null) { sessionIds.add(sessionId); } } while (sessionId != null); if (!sessionIds.isEmpty()) { ssoService.touchSessions(new ArrayList<Long>(sessionIds)); } } }
public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (authentication instanceof SSOAuthenticationRequest) { SSOAuthenticationRequest authRequest = (SSOAuthenticationRequest) authentication; if (authRequest.getSubsystemToken() == null) { throw new BadCredentialsException("Null subsystem token"); } SSOUser ssoUser = ssoService.exchangeSubsystemToken(authRequest.getSubsystemToken()); if (ssoUser == null) { throw new BadCredentialsException("Bad credentials"); } if (ssoUser.getActionsMap().isEmpty()) { throw new BadCredentialsException("No roles"); } return createAuthentication(ssoUser); } return null; }
public Authentication authenticate(Authentication authentication) throws AuthenticationException { Authentication result = null; if (authentication instanceof CheckHOTPToken) { CheckHOTPToken authRequest = (CheckHOTPToken) authentication; if (authRequest.getCredentials() == null) { throw new BadOTPValueException("Null HOTP value"); } boolean ok = ssoService.authenticateUsingHOTP(authRequest.getName(), authRequest.getCredentials().toString()); if (!ok) { throw new BadOTPValueException("Invalid HOTP value"); } result = createAuthentication(authRequest.getSsoUser()); } return result; }
public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (authentication instanceof UsernamePasswordAuthRequestInfoAuthenticationToken) { UsernamePasswordAuthRequestInfoAuthenticationToken authRequest = (UsernamePasswordAuthRequestInfoAuthenticationToken) authentication; if (authRequest.getCredentials() == null) { throw new BadCredentialsException("Null credentials"); } SSOUser ssoUser = ssoService.authenticate(authRequest.getName(), authRequest.getCredentials().toString(), authRequest.getAuthRequestInfo()); if (ssoUser == null) { throw new BadCredentialsException("Bad credentials"); } if (ssoUser.getActionsMap().isEmpty()) { throw new BadCredentialsException("No roles"); } return createAuthentication(ssoUser); } return null; }