クラス AnonymousAuthenticationFilter

java.lang.ObjectSE
org.springframework.web.filter.GenericFilterBean
org.springframework.security.web.authentication.AnonymousAuthenticationFilter
実装されたすべてのインターフェース:
jakarta.servlet.Filterorg.springframework.beans.factory.Awareorg.springframework.beans.factory.BeanNameAwareorg.springframework.beans.factory.DisposableBeanorg.springframework.beans.factory.InitializingBeanorg.springframework.context.EnvironmentAwareorg.springframework.core.env.EnvironmentCapableorg.springframework.web.context.ServletContextAware

public class AnonymousAuthenticationFilter extends org.springframework.web.filter.GenericFilterBean implements org.springframework.beans.factory.InitializingBean
SecurityContextHolder に Authentication オブジェクトがないかどうかを検出し、必要に応じてオブジェクトを設定します。
  • コンストラクターの詳細

    • AnonymousAuthenticationFilter

      public AnonymousAuthenticationFilter(StringSE key)
      "anonymousUser" という名前のプリンシパルと単一の権限 "ROLE_ANONYMOUS" を持つフィルターを作成します。
      パラメーター:
      key - このフィルターによって作成されたトークンを識別するためのキー
    • AnonymousAuthenticationFilter

      public AnonymousAuthenticationFilter(StringSE key, ObjectSE principal, ListSE<GrantedAuthority> authorities)
      パラメーター:
      key - このフィルターによって作成されたトークンを識別するためのキー
      principal - 匿名ユーザーを表すために使用されるプリンシパル
      authorities - 匿名ユーザーの権限リスト
  • メソッドの詳細

    • afterPropertiesSet

      public void afterPropertiesSet()
      次で指定:
      インターフェース org.springframework.beans.factory.InitializingBeanafterPropertiesSet 
      オーバーライド:
      クラス org.springframework.web.filter.GenericFilterBeanafterPropertiesSet 
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) throws IOExceptionSE, jakarta.servlet.ServletException
      次で指定:
      インターフェース jakarta.servlet.FilterdoFilter 
      例外:
      IOExceptionSE
      jakarta.servlet.ServletException
    • createAuthentication

      protected Authentication createAuthentication(jakarta.servlet.http.HttpServletRequest request)
    • setAuthenticationDetailsSource

      public void setAuthenticationDetailsSource(AuthenticationDetailsSource<jakarta.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
    • setSecurityContextHolderStrategy

      public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy)
      使用する SecurityContextHolderStrategy を設定します。デフォルトのアクションは、SecurityContextHolder に格納されている SecurityContextHolderStrategy を使用することです。
      導入:
      5.8
    • getPrincipal

      public ObjectSE getPrincipal()
    • getAuthorities

      public ListSE<GrantedAuthority> getAuthorities()