ResourceServerConfig.java 891 B

1234567891011121314151617
  1. package com.ym.config;
  2. import org.springframework.context.annotation.Configuration;
  3. import org.springframework.security.config.annotation.web.builders.HttpSecurity;
  4. import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
  5. import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
  6. @Configuration
  7. @EnableResourceServer
  8. public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
  9. @Override
  10. public void configure(HttpSecurity http) throws Exception {
  11. http.authorizeRequests().antMatchers("/v2/api-docs","/user/register",
  12. "/group/join","/group/create","/room/leave","/room/statusSync",
  13. "/room/statusImMsg","/group/batchDismiss","/private/send","/group/send").permitAll().anyRequest().authenticated().and().csrf().disable();
  14. }
  15. }