クラス JwtBearerTokenAuthenticationConverter

java.lang.ObjectSE
org.springframework.security.oauth2.server.resource.authentication.JwtBearerTokenAuthenticationConverter
実装済みのインターフェース一覧:
org.springframework.core.convert.converter.Converter<Jwt, AbstractAuthenticationToken>

public final class JwtBearerTokenAuthenticationConverter extends ObjectSE implements org.springframework.core.convert.converter.Converter<Jwt, AbstractAuthenticationToken>
Jwt を受け取り、それを BearerTokenAuthentication に変換する Converter。このプロセスでは、「スコープ」または "scp" 属性のいずれかが最初に見つかった方の解析を試みます。これは単なるアダプターであるため、この実装を構成することは意図されていません。たとえば、カスタム JwtGrantedAuthoritiesConverter を使用している場合は、カスタム JwtGrantedAuthoritiesConverter に委譲して適切な BearerTokenAuthentication をインスタンス化する独自の Converter を作成することをお勧めします。
導入:
5.2
  • コンストラクターの詳細

    • JwtBearerTokenAuthenticationConverter

      public JwtBearerTokenAuthenticationConverter()
  • 方法の詳細

    • convert

      public AbstractAuthenticationToken convert(Jwt jwt)
      次で指定:
      インターフェース org.springframework.core.convert.converter.Converter<Jwt, AbstractAuthenticationToken> 内の convert 
    • setJwtPrincipalConverter

      public void setJwtPrincipalConverter(org.springframework.core.convert.converter.Converter<Jwt, OAuth2AuthenticatedPrincipal> jwtPrincipalConverter)
      使用する Converter<Jwt, OAuth2AuthenticatedPrincipal> を設定します。

      デフォルトでは、Jwt から派生したクレームと権限に基づいて DefaultOAuth2AuthenticatedPrincipal を構築します。

      パラメーター:
      jwtPrincipalConverter - コンバーター
      導入:
      7.1