IntegratedSecurityService implements SecurityService { @Override public Subject login(final Properties credentials) { if (credentials == null) { throw new AuthenticationRequiredException("credentials are null"); } ThreadContext.remove(); Subject currentUser = SecurityUtils.getSubject(); GeodeAuthenticationToken token = new GeodeAuthenticationToken(credentials); try { logger.debug("Logging in " + token.getPrincipal()); currentUser.login(token); } catch (ShiroException e) { logger.info("error logging in: " + token.getPrincipal()); throw new AuthenticationFailedException( "Authentication error. Please check your credentials.", e); } Session currentSession = currentUser.getSession(); currentSession.setAttribute(CREDENTIALS_SESSION_ATTRIBUTE, credentials); return currentUser; } IntegratedSecurityService(SecurityManagerProvider provider, PostProcessor postProcessor); @Override PostProcessor getPostProcessor(); @Override SecurityManager getSecurityManager(); @Override Subject getSubject(); @Override Subject login(final Properties credentials); @Override void logout(); @Override Callable associateWith(final Callable callable); @Override ThreadState bindSubject(final Subject subject); @Override void authorize(Resource resource, Operation operation); @Override void authorize(Resource resource, Operation operation, Target target); @Override void authorize(Resource resource, Operation operation, String target); @Override void authorize(Resource resource, Operation operation, Target target, String key); @Override void authorize(Resource resource, Operation operation, String target, Object key); @Override void authorize(final ResourcePermission context); @Override void authorize(ResourcePermission context, Subject currentUser); @Override void close(); @Override boolean needPostProcess(); @Override Object postProcess(final String regionPath, final Object key, final Object value,
      final boolean valueIsSerialized); @Override Object postProcess(Object principal, final String regionPath, final Object key,
      final Object value, final boolean valueIsSerialized); @Override boolean isIntegratedSecurity(); @Override boolean isClientSecurityRequired(); @Override boolean isPeerSecurityRequired(); static final String CREDENTIALS_SESSION_ATTRIBUTE; }
@Test public void login_nullProperties_shouldReturn_null() throws Exception { assertThatThrownBy(() -> this.securityService.login(null)) .isInstanceOf(AuthenticationRequiredException.class) .hasMessageContaining("credentials are null"); }