Search in sources :

Example 6 with FrameworkEndpointHandlerMapping

use of org.springframework.security.oauth2.provider.endpoint.FrameworkEndpointHandlerMapping in project spring-security-oauth by spring-projects.

the class AuthorizationServerEndpointsConfiguration method authorizationEndpoint.

@Bean
public AuthorizationEndpoint authorizationEndpoint() throws Exception {
    AuthorizationEndpoint authorizationEndpoint = new AuthorizationEndpoint();
    FrameworkEndpointHandlerMapping mapping = getEndpointsConfigurer().getFrameworkEndpointHandlerMapping();
    authorizationEndpoint.setUserApprovalPage(extractPath(mapping, "/oauth/confirm_access"));
    authorizationEndpoint.setProviderExceptionHandler(exceptionTranslator());
    authorizationEndpoint.setErrorPage(extractPath(mapping, "/oauth/error"));
    authorizationEndpoint.setTokenGranter(tokenGranter());
    authorizationEndpoint.setClientDetailsService(clientDetailsService);
    authorizationEndpoint.setAuthorizationCodeServices(authorizationCodeServices());
    authorizationEndpoint.setOAuth2RequestFactory(oauth2RequestFactory());
    authorizationEndpoint.setOAuth2RequestValidator(oauth2RequestValidator());
    authorizationEndpoint.setUserApprovalHandler(userApprovalHandler());
    authorizationEndpoint.setRedirectResolver(redirectResolver());
    return authorizationEndpoint;
}
Also used : FrameworkEndpointHandlerMapping(org.springframework.security.oauth2.provider.endpoint.FrameworkEndpointHandlerMapping) AuthorizationEndpoint(org.springframework.security.oauth2.provider.endpoint.AuthorizationEndpoint) AbstractFactoryBean(org.springframework.beans.factory.config.AbstractFactoryBean) FactoryBean(org.springframework.beans.factory.FactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

FrameworkEndpointHandlerMapping (org.springframework.security.oauth2.provider.endpoint.FrameworkEndpointHandlerMapping)4 ClientCredentialsTokenEndpointFilter (org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter)2 Filter (javax.servlet.Filter)1 Test (org.junit.Test)1 FactoryBean (org.springframework.beans.factory.FactoryBean)1 AbstractFactoryBean (org.springframework.beans.factory.config.AbstractFactoryBean)1 Bean (org.springframework.context.annotation.Bean)1 AuthenticationManager (org.springframework.security.authentication.AuthenticationManager)1 UserDetailsService (org.springframework.security.core.userdetails.UserDetailsService)1 AuthorizationServerSecurityConfigurer (org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer)1 AuthorizationEndpoint (org.springframework.security.oauth2.provider.endpoint.AuthorizationEndpoint)1 OAuth2AuthenticationEntryPoint (org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint)1 BasicAuthenticationFilter (org.springframework.security.web.authentication.www.BasicAuthenticationFilter)1