@ -1,5 +1,5 @@
/ *
* Copyright 2012 - 201 5 the original author or authors .
* Copyright 2012 - 201 6 the original author or authors .
*
* Licensed under the Apache License , Version 2.0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -23,12 +23,12 @@ import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.framework.ProxyFactory ;
import org.springframework.beans.BeansException ;
import org.springframework.beans.factory.BeanFactory ;
import org.springframework.beans.factory.BeanFactoryAware ;
import org.springframework.beans.factory.config.BeanPostProcessor ;
import org.springframework.boot.autoconfigure.condition.ConditionOutcome ;
import org.springframework.boot.autoconfigure.condition.SpringBootCondition ;
import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2SsoCustomConfiguration.WebSecurityEnhancerCondition ;
import org.springframework.context.ApplicationContext ;
import org.springframework.context.ApplicationContextAware ;
import org.springframework.context.annotation.ConditionContext ;
import org.springframework.context.annotation.Conditional ;
import org.springframework.context.annotation.Configuration ;
@ -51,15 +51,15 @@ import org.springframework.util.ReflectionUtils;
@Configuration
@Conditional ( WebSecurityEnhancerCondition . class )
public class OAuth2SsoCustomConfiguration
implements ImportAware , BeanPostProcessor , BeanFactory Aware {
implements ImportAware , BeanPostProcessor , ApplicationContext Aware {
private Class < ? > configType ;
private BeanFactory beanFactory ;
private ApplicationContext applicationContext ;
@Override
public void set BeanFactory( BeanFactory beanFactory ) throws BeansException {
this . beanFactory = beanFactory ;
public void set ApplicationContext( ApplicationContext applicationContext ) {
this . applicationContext = applicationContext ;
}
@Override
@ -82,7 +82,7 @@ public class OAuth2SsoCustomConfiguration
& & bean instanceof WebSecurityConfigurerAdapter ) {
ProxyFactory factory = new ProxyFactory ( ) ;
factory . setTarget ( bean ) ;
factory . addAdvice ( new SsoSecurityAdapter ( this . beanFactory ) ) ;
factory . addAdvice ( new SsoSecurityAdapter ( this . applicationContext ) ) ;
bean = factory . getProxy ( ) ;
}
return bean ;
@ -92,8 +92,8 @@ public class OAuth2SsoCustomConfiguration
private SsoSecurityConfigurer configurer ;
SsoSecurityAdapter ( BeanFactory beanFactory ) {
this . configurer = new SsoSecurityConfigurer ( beanFactory ) ;
SsoSecurityAdapter ( ApplicationContext applicationContext ) {
this . configurer = new SsoSecurityConfigurer ( applicationContext ) ;
}
@Override