Class AuthorizationServerConfig

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

    @Configuration
    @EnableAuthorizationServer
    public class AuthorizationServerConfig
    extends org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter
    This class enables and configures the Authorization Server. The class is also responsible for granting authorization to the client. This class is responsible for generating and maintaining the access tokens.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configure​(org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer configurer)
      Method to configure the Client Details Service for our application.
      void configure​(org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer endpoints)
      Connects are endpoints to our custom authentication server and token store.
      • Methods inherited from class org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter

        configure
      • Methods inherited from class java.lang.Object

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

      • AuthorizationServerConfig

        public AuthorizationServerConfig()
    • Method Detail

      • configure

        public void configure​(org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer configurer)
                       throws java.lang.Exception
        Method to configure the Client Details Service for our application. This is created and managed by Spring. We just need to give it our custom configuration.
        Specified by:
        configure in interface org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurer
        Overrides:
        configure in class org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter
        Parameters:
        configurer - The ClientDetailsServiceConfigurer used in our application. Spring Boot Security created this for us. We just use it.
        Throws:
        java.lang.Exception - if the configuration fails
      • configure

        public void configure​(org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer endpoints)
                       throws java.lang.Exception
        Connects are endpoints to our custom authentication server and token store. We can also rename the endpoints for certain oauth functions
        Specified by:
        configure in interface org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurer
        Overrides:
        configure in class org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter
        Parameters:
        endpoints - The Authorization Server Endpoints Configurer is created and managed by Spring Boot Security. We give the configurer some custom configuration and let it work!
        Throws:
        java.lang.Exception - if the configuration fails