@Test public void testEmptyGetPreAuthenticatedPrincipal() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); FederatedUser principal = (FederatedUser) filter.getPreAuthenticatedPrincipal(request); assertNull(principal); }
@Override protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { Optional<FederatedUser> federatedUser = federatedUserBuilder.shibUser(request); if (!federatedUser.isPresent()) { return null; } if (hasText(getHeader(X_IMPERSONATE, request))) { federatedUser = federatedUserBuilder.basicAuthUser(request, apiAuthorities); } return federatedUser.isPresent() ? federatedUser.get() : null; }
ShibbolethPreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { @Override protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { Optional<FederatedUser> federatedUser = federatedUserBuilder.shibUser(request); if (!federatedUser.isPresent()) { return null; } if (hasText(getHeader(X_IMPERSONATE, request))) { federatedUser = federatedUserBuilder.basicAuthUser(request, apiAuthorities); } return federatedUser.isPresent() ? federatedUser.get() : null; } }
ShibbolethPreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { @Override protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { Optional<FederatedUser> federatedUser = federatedUserBuilder.shibUser(request); if (!federatedUser.isPresent()) { return null; } if (hasText(getHeader(X_IMPERSONATE, request))) { federatedUser = federatedUserBuilder.basicAuthUser(request, apiAuthorities); } return federatedUser.isPresent() ? federatedUser.get() : null; } ShibbolethPreAuthenticatedProcessingFilter(AuthenticationManager authenticationManager, Manage manage); }
ShibbolethPreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { @Override protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { Optional<FederatedUser> federatedUser = federatedUserBuilder.shibUser(request); if (!federatedUser.isPresent()) { return null; } if (hasText(getHeader(X_IMPERSONATE, request))) { federatedUser = federatedUserBuilder.basicAuthUser(request, apiAuthorities); } return federatedUser.isPresent() ? federatedUser.get() : null; } ShibbolethPreAuthenticatedProcessingFilter(AuthenticationManager authenticationManager, Manage manage);  }
ShibbolethPreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { @Override protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { Optional<FederatedUser> federatedUser = federatedUserBuilder.shibUser(request); if (!federatedUser.isPresent()) { return null; } if (hasText(getHeader(X_IMPERSONATE, request))) { federatedUser = federatedUserBuilder.basicAuthUser(request, apiAuthorities); } return federatedUser.isPresent() ? federatedUser.get() : null; } ShibbolethPreAuthenticatedProcessingFilter(AuthenticationManager authenticationManager, Manage manage);   }