i created a new spring boot application and I am trying to integrate the 
existing CAS server for sso. I added configuration in the application. 
properties and I also created casconfig class file in an application and I 
added bean class over here. 
when I run my application got my cas login page when I enter user details 
able to authenticate but not able to get user details. do you guys have any 
idea on this. 

cas.server-url-prefix= localhost:8900/cas-web
cas.server-login-url=localhost:8900/cas-web/login
cas.client-host-url=http://localhost:8080
cas.validation-type=CAS


cas class : 

@Autowired
private CasProperties casProperties;
private static final Logger logger = 
LoggerFactory.getLogger(SecurityConfig.class);

@Override
protected void configure(AuthenticationManagerBuilder auth) throws 
Exception {
super.configure(auth);
auth.authenticationProvider(casAuthenticationProvider());
}

@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.authorizeRequests().antMatchers("/*").permitAll().anyRequest().authenticated();
}

@Bean
public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
CasAuthenticationEntryPoint casAuthenticationEntryPoint = new 
CasAuthenticationEntryPoint();
casAuthenticationEntryPoint.setLoginUrl(casProperties.getCasServerLoginUrl());
casAuthenticationEntryPoint.setServiceProperties(serviceProperties());
return casAuthenticationEntryPoint;
}

@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setService(casProperties.getAppServerUrl() + 
casProperties.getAppServerLoginUrl());
serviceProperties.setSendRenew(false);
return serviceProperties;
}

@Bean
public CasAuthenticationFilter casAuthenticationFilter() throws Exception {
CasAuthenticationFilter casAuthenticationFilter = new 
CasAuthenticationFilter();
casAuthenticationFilter.setAuthenticationManager(authenticationManager());
casAuthenticationFilter.setFilterProcessesUrl(casProperties.getAppServerLoginUrl());
return casAuthenticationFilter;
}

@Bean
public CasAuthenticationProvider casAuthenticationProvider() {
CasAuthenticationProvider casAuthenticationProvider = new 
CasAuthenticationProvider();
casAuthenticationProvider.setAuthenticationUserDetailsService(userDetailsByNameServiceWrapper());
casAuthenticationProvider.setServiceProperties(serviceProperties());
casAuthenticationProvider.setTicketValidator(new 
Cas20ServiceTicketValidator(casProperties.getCasServerUrl()));
casAuthenticationProvider.setKey("my_password_for_this_auth_provider_only");
return casAuthenticationProvider;
}

@Bean
public UserDetailsByNameServiceWrapper userDetailsByNameServiceWrapper() {
UserDetailsByNameServiceWrapper userDetailsByNameServiceWrapper = new 
UserDetailsByNameServiceWrapper();
userDetailsByNameServiceWrapper.setUserDetailsService(userDetailsService());
return userDetailsByNameServiceWrapper;
}


@Autowired
    public void configureGlobal(AuthenticationManagerBuilder 
authenticationManagerBuilder) throws Exception {
        authenticationManagerBuilder.userDetailsService(userDetailsService);
    }

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/fe03a5fc-ba0f-427b-8e9a-4b0693d68316n%40apereo.org.

Reply via email to