As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
@Configuration protected static class AuthConfig extends WebSecurityConfigurerAdapter { @Value('${authn.authnUrl}') private String authnUrl; @Value('${authn.clientId}') private String clientId; @Value('${authn.privateKeyPath}') private String privateKeyPath; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(new PreAuthAuthenticationProvider()); } @Override public void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .anyRequest() .authenticated() .and() .addFilterBefore(authnFilter(), SecurityContextPersistenceFilter.class) .addFilterAfter(preAuthFilter(), LogoutFilter.class) .exceptionHandling() .authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint('/login')); } private Filter preAuthFilter() throws Exception { PreAuthProcessingFilter filter = new PreAuthProcessingFilter(); filter.setAuthenticationManager(authenticationManager()); return filter; } private Filter authnFilter() { return new AuthnFilterBuilder() .setAuthnUrl(authnUrl) .setClientId(clientId) .setPrivateKeyPath(privateKeyPath) .enableSystemAuth() .enableUIAuth() .build(); } }