Example usage for org.springframework.security.cas.web CasAuthenticationEntryPoint setServiceProperties

List of usage examples for org.springframework.security.cas.web CasAuthenticationEntryPoint setServiceProperties

Introduction

In this page you can find the example usage for org.springframework.security.cas.web CasAuthenticationEntryPoint setServiceProperties.

Prototype

public final void setServiceProperties(final ServiceProperties serviceProperties) 

Source Link

Usage

From source file:fr.univlorraine.mondossierweb.config.SecurityConfig.java

@Bean
public CasAuthenticationEntryPoint casEntryPoint() {
    CasAuthenticationEntryPoint casEntryPoint = new CasAuthenticationEntryPoint();
    casEntryPoint.setLoginUrl(environment.getRequiredProperty("cas.url") + "/login");
    casEntryPoint.setServiceProperties(casServiceProperties());
    return casEntryPoint;
}

From source file:net.oneandone.stool.overview.config.SecurityConfiguration.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    CasAuthenticationFilter filter;/*  w ww.j a v  a2 s. c  om*/
    CasAuthenticationEntryPoint entryPoint;

    filter = new CasAuthenticationFilter();
    filter.setAuthenticationManager(authenticationManager());
    entryPoint = new CasAuthenticationEntryPoint();
    entryPoint.setLoginUrl(session.configuration.ldapSso + "/login/");
    entryPoint.setServiceProperties(serviceProperties());
    http.csrf().disable().exceptionHandling().authenticationEntryPoint(entryPoint).and().addFilter(filter);
    if (session.configuration.ldapUrl.isEmpty()) {
        http.authorizeRequests().antMatchers("/**").hasRole("ANONYMOUS");
    } else {
        http.authorizeRequests().antMatchers("/whoami").fullyAuthenticated().antMatchers("/**")
                .hasRole("LOGIN");
    }
}

From source file:de.thm.arsnova.config.SecurityConfig.java

@Bean
public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
    CasAuthenticationEntryPoint entryPoint = new CasAuthenticationEntryPoint();
    entryPoint.setLoginUrl(casUrl + "/login");
    entryPoint.setServiceProperties(casServiceProperties());

    return entryPoint;
}

From source file:org.ambraproject.wombat.config.SpringSecurityConfiguration.java

private CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
    return runtimeConfiguration.getCasConfiguration().map(casConfiguration -> {
        CasAuthenticationEntryPoint casAuthenticationEntryPoint = new CasAuthenticationEntryPoint() {
            @Override/*from   ww  w. j a v a2  s .c om*/
            protected String createServiceUrl(final HttpServletRequest request,
                    final HttpServletResponse response) {
                return getCasValidationPath(request);
            }
        };
        casAuthenticationEntryPoint.setLoginUrl(casConfiguration.getLoginUrl());
        casAuthenticationEntryPoint.setServiceProperties(serviceProperties());
        return casAuthenticationEntryPoint;
    }).orElseThrow(CasConfigurationRequiredException::new);
}