A B C D E F G H I J L M O P R S T U V W X
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- acceptMediaType(MediaType) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
Specify a media type to set as the Accept header in the request.
- accessToken(OAuth2AccessToken) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2ClientMutator
-
Use this
OAuth2AccessToken
- accessToken(OAuth2AccessToken) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
-
Use this
OAuth2AccessToken
- accountExpired(boolean) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
- accountLocked(boolean) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
- afterConfigureAdded(WebTestClient.MockServerSpec<?>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.CsrfMutator
- afterConfigureAdded(WebTestClient.MockServerSpec<?>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
- afterConfigureAdded(WebTestClient.MockServerSpec<?>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2ClientMutator
- afterConfigureAdded(WebTestClient.MockServerSpec<?>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
- afterConfigureAdded(WebTestClient.MockServerSpec<?>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
- afterConfigureAdded(WebTestClient.MockServerSpec<?>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OpaqueTokenMutator
- afterConfigureAdded(WebTestClient.MockServerSpec<?>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
- afterConfigurerAdded(WebTestClient.Builder, WebHttpHandlerBuilder, ClientHttpConnector) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.CsrfMutator
- afterConfigurerAdded(WebTestClient.Builder, WebHttpHandlerBuilder, ClientHttpConnector) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
- afterConfigurerAdded(WebTestClient.Builder, WebHttpHandlerBuilder, ClientHttpConnector) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2ClientMutator
- afterConfigurerAdded(WebTestClient.Builder, WebHttpHandlerBuilder, ClientHttpConnector) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
- afterConfigurerAdded(WebTestClient.Builder, WebHttpHandlerBuilder, ClientHttpConnector) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
- afterConfigurerAdded(WebTestClient.Builder, WebHttpHandlerBuilder, ClientHttpConnector) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OpaqueTokenMutator
- afterConfigurerAdded(WebTestClient.Builder, WebHttpHandlerBuilder, ClientHttpConnector) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
- afterTestMethod(TestContext) - Method in class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
-
Clears out the
TestSecurityContextHolder
and theSecurityContextHolder
after each test method. - anonymous() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContext
that uses anAnonymousAuthenticationToken
. - asHeader() - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
-
Instead of using the
CsrfToken
as a request parameter (default) will populate theCsrfToken
as a header. - attributes(Consumer<Map<String, Object>>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
-
Mutate the attributes using the given
Consumer
- attributes(Consumer<Map<String, Object>>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OpaqueTokenMutator
-
Mutate the attributes using the given
Consumer
- attributes(Consumer<Map<String, Object>>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor
-
Mutate the attributes using the given
Consumer
- attributes(Consumer<Map<String, Object>>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor
-
Mutate the attributes using the given
Consumer
- authenticated() - Static method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers
-
ResultMatcher
that verifies that a specified user is authenticated. - authentication(Authentication) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContext
that uses the specifiedAuthentication
for theAuthentication.getPrincipal()
and a customUserDetails
. - authorities() - Method in annotation type org.springframework.security.test.context.support.WithMockUser
-
The authorities to use.
- authorities(String...) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
-
Specifies the
GrantedAuthority
s to use. - authorities(Collection<? extends GrantedAuthority>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
-
Specifies the
GrantedAuthority
s to use. - authorities(Collection<? extends GrantedAuthority>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
-
Populates the user's
GrantedAuthority
's. - authorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
-
Use the provided authorities in the token
- authorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
-
Use the provided authorities in the
Authentication
- authorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided authorities in the
Authentication
- authorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OpaqueTokenMutator
-
Use the provided authorities in the resulting principal
- authorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
-
Use the provided authorities in the token
- authorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor
-
Use the provided authorities in the
Authentication
- authorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided authorities in the
Authentication
- authorities(Collection<GrantedAuthority>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor
-
Use the provided authorities in the resulting principal
- authorities(Converter<Jwt, Collection<GrantedAuthority>>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
-
Provides the configured
Jwt
so that custom authorities can be derived from it - authorities(Converter<Jwt, Collection<GrantedAuthority>>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
-
Provides the configured
Jwt
so that custom authorities can be derived from it - authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
-
Use the provided authorities in the token
- authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
-
Use the provided authorities in the
Authentication
- authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided authorities in the
Authentication
- authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OpaqueTokenMutator
-
Use the provided authorities in the resulting principal
- authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
-
Specifies the
GrantedAuthority
s to use. - authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
-
Use the provided authorities in the token
- authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor
-
Use the provided authorities in the
Authentication
- authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided authorities in the
Authentication
- authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor
-
Use the provided authorities in the resulting principal
- authorities(GrantedAuthority...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
-
Populates the user's
GrantedAuthority
's.
B
- beforeServerCreated(WebHttpHandlerBuilder) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.CsrfMutator
- beforeServerCreated(WebHttpHandlerBuilder) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
- beforeServerCreated(WebHttpHandlerBuilder) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2ClientMutator
- beforeServerCreated(WebHttpHandlerBuilder) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
- beforeServerCreated(WebHttpHandlerBuilder) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
- beforeServerCreated(WebHttpHandlerBuilder) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OpaqueTokenMutator
- beforeServerCreated(WebHttpHandlerBuilder) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
- beforeTestExecution(TestContext) - Method in class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
-
If configured before test execution sets the SecurityContext
- beforeTestMethod(TestContext) - Method in class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
-
Sets up the
SecurityContext
for each test method. - buildRequest(ServletContext) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
- buildRequest(ServletContext) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.LogoutRequestBuilder
C
- clearContext() - Static method in class org.springframework.security.test.context.TestSecurityContextHolder
- clearContext() - Method in class org.springframework.security.test.context.TestSecurityContextHolderStrategyAdapter
- clientRegistration(Consumer<ClientRegistration.Builder>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2ClientMutator
-
Use this
Consumer
to configure aClientRegistration
- clientRegistration(Consumer<ClientRegistration.Builder>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
-
Use this
Consumer
to configure aClientRegistration
- clientRegistration(ClientRegistration) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2ClientMutator
-
Use this
ClientRegistration
- clientRegistration(ClientRegistration) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
-
Use the provided
ClientRegistration
as the client to authorize. - clientRegistration(ClientRegistration) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided
ClientRegistration
as the client to authorize. - clientRegistration(ClientRegistration) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
-
Use this
ClientRegistration
- clientRegistration(ClientRegistration) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor
-
Use the provided
ClientRegistration
as the client to authorize. - clientRegistration(ClientRegistration) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided
ClientRegistration
as the client to authorize. - createEmptyContext() - Method in class org.springframework.security.test.context.TestSecurityContextHolderStrategyAdapter
- createSecurityContext(A) - Method in interface org.springframework.security.test.context.support.WithSecurityContextFactory
-
Create a
SecurityContext
given an Annotation. - credentialsExpired(boolean) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
- csrf() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
- csrf() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Creates a
RequestPostProcessor
that will automatically populate a validCsrfToken
in the request.
D
- digest() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Creates a DigestRequestPostProcessor that enables easily adding digest based authentication to a request.
- digest(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Creates a DigestRequestPostProcessor that enables easily adding digest based authentication to a request.
- DigestRequestPostProcessor() - Constructor for class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor
- disabled(boolean) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
E
- exportTestSecurityContext() - Static method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultHandlers
F
- factory() - Method in annotation type org.springframework.security.test.context.support.WithSecurityContext
-
The
WithUserDetailsSecurityContextFactory
to use to create theSecurityContext
. - formLogin() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
-
Creates a request (including any necessary
CsrfToken
) that will submit a form based login to POST "/login". - formLogin(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
-
Creates a request (including any necessary
CsrfToken
) that will submit a form based login to POSTloginProcessingUrl
.
G
- getContext() - Static method in class org.springframework.security.test.context.TestSecurityContextHolder
-
Gets the
SecurityContext
fromTestSecurityContextHolder
. - getContext() - Method in class org.springframework.security.test.context.TestSecurityContextHolderStrategyAdapter
- getCsrfTokenRepository(HttpServletRequest) - Static method in class org.springframework.security.test.web.support.WebTestUtils
-
Gets the
CsrfTokenRepository
for the specifiedHttpServletRequest
. - getCsrfTokenRequestHandler(HttpServletRequest) - Static method in class org.springframework.security.test.web.support.WebTestUtils
-
Gets the
CsrfTokenRequestHandler
for the specifiedHttpServletRequest
. - getOrder() - Method in class org.springframework.security.test.context.support.ReactorContextTestExecutionListener
-
Returns
11000
. - getOrder() - Method in class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
-
Returns
10000
. - getSecurityContextRepository(HttpServletRequest) - Static method in class org.springframework.security.test.web.support.WebTestUtils
-
Gets the
SecurityContextRepository
for the specifiedHttpServletRequest
.
H
- httpBasic(String, String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Convenience mechanism for setting the Authorization header to use HTTP Basic with the given username and password.
I
- idToken(Consumer<OidcIdToken.Builder>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided
OidcIdToken
when constructing the authenticated user - idToken(Consumer<OidcIdToken.Builder>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided
OidcIdToken
when constructing the authenticated user - isMergeEnabled() - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
- isMergeEnabled() - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.LogoutRequestBuilder
J
- jwt() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContext
that has aJwtAuthenticationToken
for theAuthentication
and aJwt
for theAuthentication.getPrincipal()
. - jwt(Consumer<Jwt.Builder>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
-
Use the given
Jwt.Builder
Consumer
to configure the underlyingJwt
This method first creates a defaultJwt.Builder
instance with default values for thealg
,sub
, andscope
claims. - jwt(Consumer<Jwt.Builder>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
-
Use the given
Jwt.Builder
Consumer
to configure the underlyingJwt
This method first creates a defaultJwt.Builder
instance with default values for thealg
,sub
, andscope
claims. - jwt(Jwt) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
-
Use the given
Jwt
- jwt(Jwt) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
-
Use the given
Jwt
L
- loginProcessingUrl(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
Specifies the URL to POST to.
- loginProcessingUrl(String, Object...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
Specifies the URL to POST to.
- logout() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
-
Creates a logout request.
- logout(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders
-
Creates a logout request (including any necessary
CsrfToken
) to the specifiedlogoutUrl
- logoutUrl(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.LogoutRequestBuilder
-
Specifies the logout URL to POST to.
- logoutUrl(String, Object...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.LogoutRequestBuilder
-
Specifies the logout URL to POST to.
M
- match(MvcResult) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
- merge(Object) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
- merge(Object) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.LogoutRequestBuilder
- mockAuthentication(Authentication) - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to use the provided Authentication as the Principal
- mockJwt() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
SecurityContext
that has aJwtAuthenticationToken
for theAuthentication
and aJwt
for theAuthentication.getPrincipal()
. - mockOAuth2Client() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
OAuth2AuthorizedClient
in the session. - mockOAuth2Client(String) - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
OAuth2AuthorizedClient
in the session. - mockOAuth2Login() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
SecurityContext
that has aOAuth2AuthenticationToken
for theAuthentication
. - mockOidcLogin() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
SecurityContext
that has aOAuth2AuthenticationToken
for theAuthentication
. - mockOpaqueToken() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
SecurityContext
that has aBearerTokenAuthentication
for theAuthentication
and anOAuth2AuthenticatedPrincipal
for theAuthentication.getPrincipal()
. - mockUser() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to use a UserDetails to create a UsernamePasswordAuthenticationToken as the Principal.
- mockUser(String) - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to use a UserDetails to create a UsernamePasswordAuthenticationToken as the Principal.
- mockUser(UserDetails) - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to use the provided UserDetails to create a UsernamePasswordAuthenticationToken as the Principal
O
- oauth2Client() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish an
OAuth2AuthorizedClient
in the session. - oauth2Client(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish an
OAuth2AuthorizedClient
in the session. - oauth2Login() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContext
that has aOAuth2AuthenticationToken
for theAuthentication
, aOAuth2User
as the principal, and aOAuth2AuthorizedClient
in the session. - oauth2User(OAuth2User) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
-
Use the provided
OAuth2User
as the authenticated user. - oauth2User(OAuth2User) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor
-
Use the provided
OAuth2User
as the authenticated user. - oidcLogin() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContext
that has aOAuth2AuthenticationToken
for theAuthentication
, aOidcUser
as the principal, and aOAuth2AuthorizedClient
in the session. - oidcUser(OidcUser) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided
OidcUser
as the authenticated user. - oidcUser(OidcUser) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided
OidcUser
as the authenticated user. - opaqueToken() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContext
that has aBearerTokenAuthentication
for theAuthentication
and aOAuth2AuthenticatedPrincipal
for theAuthentication.getPrincipal()
. - org.springframework.security.test.context - package org.springframework.security.test.context
- org.springframework.security.test.context.annotation - package org.springframework.security.test.context.annotation
- org.springframework.security.test.context.support - package org.springframework.security.test.context.support
- org.springframework.security.test.web.reactive.server - package org.springframework.security.test.web.reactive.server
- org.springframework.security.test.web.servlet.request - package org.springframework.security.test.web.servlet.request
- org.springframework.security.test.web.servlet.response - package org.springframework.security.test.web.servlet.response
- org.springframework.security.test.web.servlet.setup - package org.springframework.security.test.web.servlet.setup
- org.springframework.security.test.web.support - package org.springframework.security.test.web.support
P
- password() - Method in annotation type org.springframework.security.test.context.support.WithMockUser
-
The password to be used.
- password(String) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
-
Specifies the password to use.
- password(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
The value of the password parameter.
- password(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor
-
Configures the password to use
- password(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
-
Populates the user's password.
- password(String, String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
Specify both the password parameter name and the password.
- passwordParam(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
The HTTP parameter to place the password.
- postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
- postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor
- postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
- postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
- postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor
- postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
- postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor
- postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
- principal(OAuth2AuthenticatedPrincipal) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OpaqueTokenMutator
-
Use the provided principal
- principal(OAuth2AuthenticatedPrincipal) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor
-
Use the provided principal
- principalName(String) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2ClientMutator
-
Use this as the resource owner's principal name
- principalName(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
-
Use this as the resource owner's principal name
R
- ReactorContextTestExecutionListener - Class in org.springframework.security.test.context.support
-
Sets up the Reactor Context with the Authentication from the TestSecurityContextHolder and then clears the Reactor Context at the end of the tests.
- ReactorContextTestExecutionListener() - Constructor for class org.springframework.security.test.context.support.ReactorContextTestExecutionListener
- realm(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor
-
Configures the realm to use
- roles() - Method in annotation type org.springframework.security.test.context.support.WithMockUser
-
The roles to use.
- roles(String...) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
-
Specifies the roles to use.
- roles(String...) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor
-
Specify the roles of the user to authenticate as.
S
- securityContext(SecurityContext) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish the specified
SecurityContext
to be used. - SecurityMockMvcConfigurers - Class in org.springframework.security.test.web.servlet.setup
-
Provides Security related
MockMvcConfigurer
implementations. - SecurityMockMvcRequestBuilders - Class in org.springframework.security.test.web.servlet.request
-
Contains Spring Security related
MockMvc
RequestBuilder
s. - SecurityMockMvcRequestBuilders.FormLoginRequestBuilder - Class in org.springframework.security.test.web.servlet.request
-
Creates a form based login request including any necessary
CsrfToken
. - SecurityMockMvcRequestBuilders.LogoutRequestBuilder - Class in org.springframework.security.test.web.servlet.request
-
Creates a logout request (including any necessary
CsrfToken
) - SecurityMockMvcRequestPostProcessors - Class in org.springframework.security.test.web.servlet.request
-
Contains
MockMvc
RequestPostProcessor
implementations for Spring Security. - SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
-
Populates a valid
CsrfToken
into the request. - SecurityMockMvcRequestPostProcessors.DigestRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
- SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
- SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
- SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
- SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
- SecurityMockMvcRequestPostProcessors.OpaqueTokenRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
- SecurityMockMvcRequestPostProcessors.UserRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
-
Creates a
UsernamePasswordAuthenticationToken
and sets the principal to be aUser
and associates it to theMockHttpServletRequest
. - SecurityMockMvcResultHandlers - Class in org.springframework.security.test.web.servlet.response
-
Security related
MockMvc
ResultHandler
s - SecurityMockMvcResultMatchers - Class in org.springframework.security.test.web.servlet.response
-
Security related
MockMvc
ResultMatcher
s. - SecurityMockMvcResultMatchers.AuthenticatedMatcher - Class in org.springframework.security.test.web.servlet.response
-
A
MockMvc
ResultMatcher
that verifies a specific user is associated to theMvcResult
. - SecurityMockServerConfigurers - Class in org.springframework.security.test.web.reactive.server
-
Test utilities for working with Spring Security and
WebTestClient.Builder.apply(WebTestClientConfigurer)
. - SecurityMockServerConfigurers.CsrfMutator - Class in org.springframework.security.test.web.reactive.server
- SecurityMockServerConfigurers.JwtMutator - Class in org.springframework.security.test.web.reactive.server
-
Updates the WebServerExchange using
{@link SecurityMockServerConfigurers#mockAuthentication(Authentication)}
. - SecurityMockServerConfigurers.OAuth2ClientMutator - Class in org.springframework.security.test.web.reactive.server
- SecurityMockServerConfigurers.OAuth2LoginMutator - Class in org.springframework.security.test.web.reactive.server
- SecurityMockServerConfigurers.OidcLoginMutator - Class in org.springframework.security.test.web.reactive.server
- SecurityMockServerConfigurers.OpaqueTokenMutator - Class in org.springframework.security.test.web.reactive.server
- SecurityMockServerConfigurers.UserExchangeMutator - Class in org.springframework.security.test.web.reactive.server
-
Updates the WebServerExchange using
{@link SecurityMockServerConfigurers#mockUser(UserDetails)}
. - SecurityTestExecutionListeners - Annotation Type in org.springframework.security.test.context.annotation
-
There are many times a user may want to use Spring Security's test support (i.e.
- setAuthentication(Authentication) - Static method in class org.springframework.security.test.context.TestSecurityContextHolder
-
Creates a new
SecurityContext
with the givenAuthentication
. - setContext(SecurityContext) - Static method in class org.springframework.security.test.context.TestSecurityContextHolder
- setContext(SecurityContext) - Method in class org.springframework.security.test.context.TestSecurityContextHolderStrategyAdapter
- setCsrfTokenRepository(HttpServletRequest, CsrfTokenRepository) - Static method in class org.springframework.security.test.web.support.WebTestUtils
-
Sets the
CsrfTokenRepository
for the specifiedHttpServletRequest
. - setSecurityContextRepository(HttpServletRequest, SecurityContextRepository) - Static method in class org.springframework.security.test.web.support.WebTestUtils
-
Sets the
SecurityContextRepository
for the specifiedHttpServletRequest
. - setupBefore() - Method in annotation type org.springframework.security.test.context.support.WithAnonymousUser
-
Determines when the
SecurityContext
is setup. - setupBefore() - Method in annotation type org.springframework.security.test.context.support.WithMockUser
-
Determines when the
SecurityContext
is setup. - setupBefore() - Method in annotation type org.springframework.security.test.context.support.WithSecurityContext
-
Determines when the
SecurityContext
is setup. - setupBefore() - Method in annotation type org.springframework.security.test.context.support.WithUserDetails
-
Determines when the
SecurityContext
is setup. - springSecurity() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Sets up Spring Security's
WebTestClient
test support - springSecurity() - Static method in class org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers
-
Configures the MockMvcBuilder for use with Spring Security.
- springSecurity(Filter) - Static method in class org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers
-
Configures the MockMvcBuilder for use with Spring Security.
T
- TEST_EXECUTION - org.springframework.security.test.context.support.TestExecutionEvent
-
Associated to
TestExecutionListener.beforeTestExecution(TestContext)
event. - TEST_METHOD - org.springframework.security.test.context.support.TestExecutionEvent
-
Associated to
TestExecutionListener.beforeTestMethod(TestContext)
event. - TestExecutionEvent - Enum in org.springframework.security.test.context.support
-
Represents the events on the methods of
TestExecutionListener
- testSecurityContext() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Creates a
RequestPostProcessor
that can be used to ensure that the resulting request is ran with the user in theTestSecurityContextHolder
. - TestSecurityContextHolder - Class in org.springframework.security.test.context
-
The
TestSecurityContextHolder
is very similar toSecurityContextHolder
, but is necessary for testing. - TestSecurityContextHolderStrategyAdapter - Class in org.springframework.security.test.context
- TestSecurityContextHolderStrategyAdapter() - Constructor for class org.springframework.security.test.context.TestSecurityContextHolderStrategyAdapter
U
- unauthenticated() - Static method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers
-
ResultMatcher
that verifies that no user is authenticated. - useInvalidToken() - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
-
Populates an invalid token value on the request.
- user(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
The value of the username parameter.
- user(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContext
that has aUsernamePasswordAuthenticationToken
for theAuthentication.getPrincipal()
and aUser
for theUsernamePasswordAuthenticationToken.getPrincipal()
. - user(String, String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
Specify both the password parameter name and the password.
- user(UserDetails) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContext
that has aUsernamePasswordAuthenticationToken
for theAuthentication.getPrincipal()
and a customUserDetails
for theUsernamePasswordAuthenticationToken.getPrincipal()
. - userDetailsServiceBeanName() - Method in annotation type org.springframework.security.test.context.support.WithUserDetails
-
The bean name for the
UserDetailsService
to use. - userInfoToken(Consumer<OidcUserInfo.Builder>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided
OidcUserInfo
when constructing the authenticated user - userInfoToken(Consumer<OidcUserInfo.Builder>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided
OidcUserInfo
when constructing the authenticated user - username() - Method in annotation type org.springframework.security.test.context.support.WithMockUser
-
The username to be used.
- userParameter(String) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder
-
The HTTP parameter to place the username.
V
- value() - Method in annotation type org.springframework.security.test.context.support.WithMockUser
-
Convenience mechanism for specifying the username.
- value() - Method in annotation type org.springframework.security.test.context.support.WithUserDetails
-
The username to look up in the
UserDetailsService
- valueOf(String) - Static method in enum org.springframework.security.test.context.support.TestExecutionEvent
-
Returns the enum constant of this type with the specified name.
- values() - Static method in enum org.springframework.security.test.context.support.TestExecutionEvent
-
Returns an array containing the constants of this enum type, in the order they are declared.
W
- WebTestUtils - Class in org.springframework.security.test.web.support
-
A utility class for testing spring security
- WithAnonymousUser - Annotation Type in org.springframework.security.test.context.support
-
When used with
WithSecurityContextTestExecutionListener
this annotation can be added to a test method to emulate running with an anonymous user. - withAuthentication(Consumer<Authentication>) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
-
Allows for any validating the authentication with arbitrary assertions
- withAuthentication(Authentication) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
-
Specifies the expected
Authentication
- withAuthenticationName(String) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
-
Specifies the expected
Principal.getName()
- withAuthenticationPrincipal(Object) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
-
Specifies the expected principal
- withAuthorities(Collection<? extends GrantedAuthority>) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
-
Specifies the
Authentication.getAuthorities()
- WithMockUser - Annotation Type in org.springframework.security.test.context.support
-
When used with
WithSecurityContextTestExecutionListener
this annotation can be added to a test method to emulate running with a mocked user. - withRoles(String...) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
-
Specifies the
Authentication.getAuthorities()
- withSecurityContext(SecurityContext) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
-
Specifies the expected
SecurityContext
- WithSecurityContext - Annotation Type in org.springframework.security.test.context.support
-
An annotation to determine what
SecurityContext
to use. - WithSecurityContextFactory<A extends java.lang.annotation.Annotation> - Interface in org.springframework.security.test.context.support
-
An API that works with WithUserTestExcecutionListener for creating a
SecurityContext
that is populated in theTestSecurityContextHolder
. - WithSecurityContextTestExecutionListener - Class in org.springframework.security.test.context.support
-
A
TestExecutionListener
that will find annotations that are annotated withWithSecurityContext
on a test method or at the class level. - WithSecurityContextTestExecutionListener() - Constructor for class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
- WithUserDetails - Annotation Type in org.springframework.security.test.context.support
-
When used with
WithSecurityContextTestExecutionListener
this annotation can be added to a test method to emulate running with aUserDetails
returned from theUserDetailsService
. - withUsername(String) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
-
Specifies the expected username
X
- x509(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Finds an X509Cetificate using a resoureName and populates it on the request.
- x509(X509Certificate...) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Populates the provided X509Certificate instances on the request.
All Classes All Packages