Class ResourceServerConfig

  • All Implemented Interfaces:
    org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurer

    @Configuration
    @EnableResourceServer
    public class ResourceServerConfig
    extends org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter
    Once the client has gained authorization, users need to gain authentication. This class is response for handling that. It also configures which roles have access to which endpoints. So controls the users' access!
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configure​(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
      This method configures which roles can access which endpoints
      void configure​(org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer resources)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourceServerConfig

        public ResourceServerConfig()
    • Method Detail

      • configure

        public void configure​(org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer resources)
        Specified by:
        configure in interface org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurer
        Overrides:
        configure in class org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter
      • configure

        public void configure​(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
                       throws java.lang.Exception
        This method configures which roles can access which endpoints
        Specified by:
        configure in interface org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurer
        Overrides:
        configure in class org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter
        Parameters:
        http - Our HttpSecurity object that is maintains by Spring
        Throws:
        java.lang.Exception - in case the configurations fails