クラス GlobalMethodSecurityConfiguration
- java.lang.Object
-
- org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration
- 実装されたすべてのインターフェース:
org.springframework.beans.factory.Aware
、org.springframework.beans.factory.BeanFactoryAware
、org.springframework.beans.factory.SmartInitializingSingleton
、org.springframework.context.annotation.ImportAware
@Configuration(proxyBeanMethods=false) @Role(2) public class GlobalMethodSecurityConfiguration extends java.lang.Object implements org.springframework.context.annotation.ImportAware, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.beans.factory.BeanFactoryAware
グローバルメソッドセキュリティを有効にするためのベースConfiguration
。クラスはこのクラスを継承してデフォルトをカスタマイズできますが、サブクラスにEnableGlobalMethodSecurity
アノテーションを指定する必要があります。- 導入:
- 3.2
- 関連事項:
EnableGlobalMethodSecurity
コンストラクターのサマリー
コンストラクター コンストラクター 説明 GlobalMethodSecurityConfiguration()
メソッドのサマリー
メソッドの詳細
methodSecurityInterceptor
@Bean public org.aopalliance.intercept.MethodInterceptor methodSecurityInterceptor(MethodSecurityMetadataSource methodSecurityMetadataSource)
次のメソッドを使用して MethodSecurityInterceptor を構成するデフォルトの MethodInterceptor を作成します。サブクラスはこのメソッドをオーバーライドして、別の
MethodInterceptor
を提供できます。- パラメーター:
methodSecurityMetadataSource
- デフォルトのMethodSecurityMetadataSource
。- 戻り値:
MethodInterceptor
afterSingletonsInstantiated
public void afterSingletonsInstantiated()
- 次で指定:
- インターフェース
org.springframework.beans.factory.SmartInitializingSingleton
のafterSingletonsInstantiated
afterInvocationManager
protected AfterInvocationManager afterInvocationManager()
methodSecurityInterceptor(MethodSecurityMetadataSource)
のデフォルト実装にカスタムAfterInvocationManager
を提供します。事前投稿が有効になっていない場合、デフォルトは null です。それ以外の場合は、AfterInvocationProviderManager
を返します。サブクラスはこのメソッドをオーバーライドして、カスタム
AfterInvocationManager
を提供する必要があります- 戻り値:
- 使用する
AfterInvocationManager
runAsManager
protected RunAsManager runAsManager()
methodSecurityInterceptor(MethodSecurityMetadataSource)
のデフォルト実装にカスタムRunAsManager
を提供します。デフォルトは null です。- 戻り値:
- 使用する
RunAsManager
accessDecisionManager
protected AccessDecisionManager accessDecisionManager()
サブクラスがカスタムAccessDecisionManager
を提供できるようにします。デフォルトはAffirmativeBased
で、次の投票者がいます:- 戻り値:
- 使用する
AccessDecisionManager
createExpressionHandler
protected MethodSecurityExpressionHandler createExpressionHandler()
ExpressionBasedPreInvocationAdvice
に登録されているMethodSecurityExpressionHandler
を提供します。デフォルトはDefaultMethodSecurityExpressionHandler
で、オプションでAuthenticationTrustResolver
をオートワイヤーします。サブクラスはこのメソッドをオーバーライドして、カスタム
MethodSecurityExpressionHandler
を提供できます- 戻り値:
- 使用する
MethodSecurityExpressionHandler
getExpressionHandler
protected final MethodSecurityExpressionHandler getExpressionHandler()
MethodSecurityExpressionHandler
を取得するか、expressionHandler
を使用して作成します。- 戻り値:
- 非
null
MethodSecurityExpressionHandler
customMethodSecurityMetadataSource
protected MethodSecurityMetadataSource customMethodSecurityMetadataSource()
methodSecurityMetadataSource()
に登録されているカスタムMethodSecurityMetadataSource
を提供します。デフォルトは null です。- 戻り値:
methodSecurityMetadataSource()
に登録されているカスタムMethodSecurityMetadataSource
authenticationManager
protected AuthenticationManager authenticationManager() throws java.lang.Exception
カスタムAuthenticationManager
を提供できます。デフォルトでは、configure(AuthenticationManagerBuilder)
によって登録された認証メカニズムを使用します。configure(AuthenticationManagerBuilder)
がオーバーライドされなかった場合、AuthenticationManager
は型によってオートワイヤーされます。- 戻り値:
- 使用する
AuthenticationManager
- 例外:
java.lang.Exception
configure
protected void configure(AuthenticationManagerBuilder auth) throws java.lang.Exception
サブクラスはこのメソッドをオーバーライドして、さまざまな型の認証を登録できます。オーバーライドされない場合、configure(AuthenticationManagerBuilder)
は型ごとにオートワイヤーを試みます。- パラメーター:
auth
- グローバルメソッドセキュリティのさまざまな認証メカニズムを登録するために使用されるAuthenticationManagerBuilder
- 例外:
java.lang.Exception
methodSecurityMetadataSource
@Bean @Role(2) public MethodSecurityMetadataSource methodSecurityMetadataSource()
使用されるデフォルトのMethodSecurityMetadataSource
を提供します。customMethodSecurityMetadataSource()
およびEnableGlobalMethodSecurity
の属性に基づいてDelegatingMethodSecurityMetadataSource
を作成します。
preInvocationAuthorizationAdvice
@Bean public PreInvocationAuthorizationAdvice preInvocationAuthorizationAdvice()
使用するPreInvocationAuthorizationAdvice
を作成します。デフォルトはExpressionBasedPreInvocationAdvice
です。
setImportMetadata
public final void setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata)
このクラスがEnableGlobalMethodSecurity
アノテーションを使用してインポートされた場合、EnableGlobalMethodSecurity
から属性を取得します。- 次で指定:
- インターフェース
org.springframework.context.annotation.ImportAware
のsetImportMetadata
setObjectPostProcessor
@Autowired(required=false) public void setObjectPostProcessor(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
setMethodSecurityExpressionHandler
@Autowired(required=false) public void setMethodSecurityExpressionHandler(java.util.List<MethodSecurityExpressionHandler> handlers)
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
- 次で指定:
- インターフェース
org.springframework.beans.factory.BeanFactoryAware
のsetBeanFactory
- 例外:
org.springframework.beans.BeansException