Package com.wilfredmorgan.api.config
Class AuthorizationServerConfig
- java.lang.Object
-
- org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter
-
- com.wilfredmorgan.api.config.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.AuthorizationServerConfigurerAdapterThis 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.
-
-
Constructor Summary
Constructors Constructor Description AuthorizationServerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer configurer)Method to configure the Client Details Service for our application.voidconfigure(org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer endpoints)Connects are endpoints to our custom authentication server and token store.
-
-
-
Method Detail
-
configure
public void configure(org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer configurer) throws java.lang.ExceptionMethod 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:
configurein interfaceorg.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurer- Overrides:
configurein classorg.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.ExceptionConnects are endpoints to our custom authentication server and token store. We can also rename the endpoints for certain oauth functions- Specified by:
configurein interfaceorg.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurer- Overrides:
configurein classorg.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
-
-