/** * Creates the {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource} to set * on the {@link J2eePreAuthenticatedProcessingFilter}. It is populated with a * {@link SimpleMappableAttributesRetriever}. * * @return the {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource} to use. */ private J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource createWebAuthenticationDetailsSource() { J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource detailsSource = new J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource(); SimpleMappableAttributesRetriever rolesRetriever = new SimpleMappableAttributesRetriever(); rolesRetriever.setMappableAttributes(mappableRoles); detailsSource.setMappableRolesRetriever(rolesRetriever); detailsSource = postProcess(detailsSource); return detailsSource; } }
/** * Gets the j 2 ee based pre authenticated web authentication details source. * * @return the j 2 ee based pre authenticated web authentication details source */ @Bean(name = "authenticationDetailsSource") public J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource getJ2eeBasedPreAuthenticatedWebAuthenticationDetailsSource() { J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource source = new J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource(); source.setMappableRolesRetriever(getWebXmlMappableAttributesRetriever()); source.setUserRoles2GrantedAuthoritiesMapper(getSimpleAttributes2GrantedAuthoritiesMapper()); return source; }
/** * Builds the authentication details object. * * @see org.springframework.security.authentication.AuthenticationDetailsSource#buildDetails(Object) */ public PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails buildDetails( HttpServletRequest context) { Collection<String> j2eeUserRoles = getUserRoles(context); Collection<? extends GrantedAuthority> userGas = j2eeUserRoles2GrantedAuthoritiesMapper .getGrantedAuthorities(j2eeUserRoles); if (logger.isDebugEnabled()) { logger.debug("J2EE roles [" + j2eeUserRoles + "] mapped to Granted Authorities: [" + userGas + "]"); } PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails result = new PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails( context, userGas); return result; }
/** * Creates the {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource} to set * on the {@link J2eePreAuthenticatedProcessingFilter}. It is populated with a * {@link SimpleMappableAttributesRetriever}. * * @return the {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource} to use. */ private J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource createWebAuthenticationDetailsSource() { J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource detailsSource = new J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource(); SimpleMappableAttributesRetriever rolesRetriever = new SimpleMappableAttributesRetriever(); rolesRetriever.setMappableAttributes(mappableRoles); detailsSource.setMappableRolesRetriever(rolesRetriever); detailsSource = postProcess(detailsSource); return detailsSource; } }
/** * Creates the {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource} to set * on the {@link J2eePreAuthenticatedProcessingFilter}. It is populated with a * {@link SimpleMappableAttributesRetriever}. * * @return the {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource} to use. */ private J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource createWebAuthenticationDetailsSource() { J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource detailsSource = new J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource(); SimpleMappableAttributesRetriever rolesRetriever = new SimpleMappableAttributesRetriever(); rolesRetriever.setMappableAttributes(mappableRoles); detailsSource.setMappableRolesRetriever(rolesRetriever); detailsSource = postProcess(detailsSource); return detailsSource; } }
/** * Creates the * {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource} to set on * the {@link J2eePreAuthenticatedProcessingFilter}. It is populated with a * {@link SimpleMappableAttributesRetriever}. * * @return the * {@link J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource} * to use. */ private J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource createWebAuthenticationDetailsSource() { J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource detailsSource = new J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource(); SimpleMappableAttributesRetriever rolesRetriever = new SimpleMappableAttributesRetriever(); rolesRetriever.setMappableAttributes(mappableRoles); detailsSource.setMappableRolesRetriever(rolesRetriever); detailsSource = postProcess(detailsSource); return detailsSource; } }