クラス SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
java.lang.ObjectSE
org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
- 実装されたすべてのインターフェース:
org.springframework.test.web.servlet.request.RequestPostProcessor
- 含まれているクラス:
- SecurityMockMvcRequestPostProcessors
public static final class SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
extends ObjectSE
implements org.springframework.test.web.servlet.request.RequestPostProcessor
- 導入:
- 5.2
メソッドのサマリー
修飾子と型メソッド説明authorities
(CollectionSE<GrantedAuthority> authorities) トークンで提供された権限を使用しますauthorities
(org.springframework.core.convert.converter.Converter<Jwt, CollectionSE<GrantedAuthority>> authoritiesConverter) 構成されたJwt
を提供し、カスタム権限を派生できるようにしますauthorities
(GrantedAuthority... authorities) トークンで提供された権限を使用しますjwt
(ConsumerSE<Jwt.Builder> jwtBuilderConsumer) 指定されたJwt.Builder
Consumer
SE を使用して、基になるJwt
を構成します。このメソッドは、最初にalg
、sub
、scope
クレームの既定値で既定のJwt.Builder
インスタンスを作成します。指定されたJwt
を使用しますorg.springframework.mock.web.MockHttpServletRequest
postProcessRequest
(org.springframework.mock.web.MockHttpServletRequest request)
メソッドの詳細
jwt
public SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor jwt(ConsumerSE<Jwt.Builder> jwtBuilderConsumer) 指定されたJwt.Builder
Consumer
SE を使用して、基になるJwt
を構成します。このメソッドは、最初にalg
、sub
、scope
クレームの既定値で既定のJwt.Builder
インスタンスを作成します。Consumer
SE は、これらを変更したり、追加の構成を提供したりできます。SecurityMockMvcRequestPostProcessors.jwt()
を呼び出すことは、SecurityMockMvcRequestPostProcessors.jwt().jwt(() -> {})
を呼び出すことと同じです。- パラメーター:
jwtBuilderConsumer
- 基礎となるJwt
を構成するため- 戻り値:
- 追加のカスタマイズのための
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
jwt
指定されたJwt
を使用します- パラメーター:
jwt
- 使用するJwt
- 戻り値:
- 追加のカスタマイズのための
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
authorities
public SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor authorities(CollectionSE<GrantedAuthority> authorities) トークンで提供された権限を使用します- パラメーター:
authorities
- 使用する権限- 戻り値:
- さらなる構成のための
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
authorities
public SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor authorities(GrantedAuthority... authorities) トークンで提供された権限を使用します- パラメーター:
authorities
- 使用する権限- 戻り値:
- さらなる構成のための
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
authorities
public SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor authorities(org.springframework.core.convert.converter.Converter<Jwt, CollectionSE<GrantedAuthority>> authoritiesConverter) 構成されたJwt
を提供し、カスタム権限を派生できるようにします- パラメーター:
authoritiesConverter
-Jwt
からGrantedAuthority
のCollection
SE への変換戦略- 戻り値:
- さらなる構成のための
SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
postProcessRequest
public org.springframework.mock.web.MockHttpServletRequest postProcessRequest(org.springframework.mock.web.MockHttpServletRequest request) - 次で指定:
- インターフェース
org.springframework.test.web.servlet.request.RequestPostProcessor
のpostProcessRequest