Index
All Classes and Interfaces|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
- afterTestClass(TestContext) - Method in class org.springframework.security.test.context.support.ReactorContextTestExecutionListener
- afterTestExecution(TestContext) - Method in class org.springframework.security.test.context.support.ReactorContextTestExecutionListener
- afterTestMethod(TestContext) - Method in class org.springframework.security.test.context.support.ReactorContextTestExecutionListener
- afterTestMethod(TestContext) - Method in class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
-
Clears out the
TestSecurityContextHolderand theSecurityContextHolderafter each test method. - anonymous() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContextthat uses anAnonymousAuthenticationToken. - asHeader() - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor
-
Instead of using the
CsrfTokenas a request parameter (default) will populate theCsrfTokenas 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
-
ResultMatcherthat verifies that a specified user is authenticated. - authentication(Authentication) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContextthat uses the specifiedAuthenticationfor theAuthentication.getPrincipal()and a customUserDetails. - authorities() - Element in annotation interface 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
GrantedAuthoritys to use. - authorities(Collection<? extends GrantedAuthority>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.UserExchangeMutator
-
Specifies the
GrantedAuthoritys 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
Jwtso 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
Jwtso 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
GrantedAuthoritys 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
- beforeTestClass(TestContext) - Method in class org.springframework.security.test.context.support.ReactorContextTestExecutionListener
- beforeTestExecution(TestContext) - Method in class org.springframework.security.test.context.support.ReactorContextTestExecutionListener
- 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.ReactorContextTestExecutionListener
- beforeTestMethod(TestContext) - Method in class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
-
Sets up the
SecurityContextfor 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
Consumerto configure aClientRegistration - clientRegistration(Consumer<ClientRegistration.Builder>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2ClientRequestPostProcessor
-
Use this
Consumerto 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
ClientRegistrationas the client to authorize. - clientRegistration(ClientRegistration) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided
ClientRegistrationas 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
ClientRegistrationas the client to authorize. - clientRegistration(ClientRegistration) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided
ClientRegistrationas 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
SecurityContextgiven 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
RequestPostProcessorthat will automatically populate a validCsrfTokenin 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() - Element in annotation interface org.springframework.security.test.context.support.WithSecurityContext
-
The
WithUserDetailsSecurityContextFactoryto 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
SecurityContextfromTestSecurityContextHolder. - 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
CsrfTokenRepositoryfor the specifiedHttpServletRequest. - getCsrfTokenRequestHandler(HttpServletRequest) - Static method in class org.springframework.security.test.web.support.WebTestUtils
-
Gets the
CsrfTokenRequestHandlerfor 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
SecurityContextRepositoryfor 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
OidcIdTokenwhen constructing the authenticated user - idToken(Consumer<OidcIdToken.Builder>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided
OidcIdTokenwhen 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
SecurityContextthat has aJwtAuthenticationTokenfor theAuthenticationand aJwtfor theAuthentication.getPrincipal(). - jwt(Consumer<Jwt.Builder>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.JwtMutator
-
Use the given
Jwt.BuilderConsumerto configure the underlyingJwtThis method first creates a defaultJwt.Builderinstance with default values for thealg,sub, andscopeclaims. - jwt(Consumer<Jwt.Builder>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.JwtRequestPostProcessor
-
Use the given
Jwt.BuilderConsumerto configure the underlyingJwtThis method first creates a defaultJwt.Builderinstance with default values for thealg,sub, andscopeclaims. - 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
- load(MvcResult) - Method in class org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.AuthenticatedMatcher
- 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
SecurityContextthat has aJwtAuthenticationTokenfor theAuthenticationand aJwtfor theAuthentication.getPrincipal(). - mockOAuth2Client() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
OAuth2AuthorizedClientin the session. - mockOAuth2Client(String) - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
OAuth2AuthorizedClientin the session. - mockOAuth2Login() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
SecurityContextthat has aOAuth2AuthenticationTokenfor theAuthentication. - mockOidcLogin() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
SecurityContextthat has aOAuth2AuthenticationTokenfor theAuthentication. - mockOpaqueToken() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Updates the ServerWebExchange to establish a
SecurityContextthat has aBearerTokenAuthenticationfor theAuthenticationand anOAuth2AuthenticatedPrincipalfor 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
OAuth2AuthorizedClientin the session. - oauth2Client(String) - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish an
OAuth2AuthorizedClientin the session. - oauth2Login() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContextthat has aOAuth2AuthenticationTokenfor theAuthentication, aOAuth2Useras the principal, and aOAuth2AuthorizedClientin the session. - oauth2User(OAuth2User) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OAuth2LoginMutator
-
Use the provided
OAuth2Useras the authenticated user. - oauth2User(OAuth2User) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OAuth2LoginRequestPostProcessor
-
Use the provided
OAuth2Useras the authenticated user. - oidcLogin() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContextthat has aOAuth2AuthenticationTokenfor theAuthentication, aOidcUseras the principal, and aOAuth2AuthorizedClientin the session. - oidcUser(OidcUser) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided
OidcUseras the authenticated user. - oidcUser(OidcUser) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided
OidcUseras the authenticated user. - opaqueToken() - Static method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors
-
Establish a
SecurityContextthat has aBearerTokenAuthenticationfor theAuthenticationand aOAuth2AuthenticatedPrincipalfor 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() - Element in annotation interface 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
- prepareTestInstance(TestContext) - Method in class org.springframework.security.test.context.support.ReactorContextTestExecutionListener
- 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() - Element in annotation interface 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
SecurityContextto be used. - SecurityMockMvcConfigurers - Class in org.springframework.security.test.web.servlet.setup
-
Provides Security related
MockMvcConfigurerimplementations. - SecurityMockMvcRequestBuilders - Class in org.springframework.security.test.web.servlet.request
-
Contains Spring Security related
MockMvcRequestBuilders. - 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
MockMvcRequestPostProcessorimplementations for Spring Security. - SecurityMockMvcRequestPostProcessors.CsrfRequestPostProcessor - Class in org.springframework.security.test.web.servlet.request
-
Populates a valid
CsrfTokeninto 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
UsernamePasswordAuthenticationTokenand sets the principal to be aUserand associates it to theMockHttpServletRequest. - SecurityMockMvcResultHandlers - Class in org.springframework.security.test.web.servlet.response
-
Security related
MockMvcResultHandlers - SecurityMockMvcResultMatchers - Class in org.springframework.security.test.web.servlet.response
-
Security related
MockMvcResultMatchers. - SecurityMockMvcResultMatchers.AuthenticatedMatcher - Class in org.springframework.security.test.web.servlet.response
-
A
MockMvcResultMatcherthat 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 Interface 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
SecurityContextwith 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
CsrfTokenRepositoryfor the specifiedHttpServletRequest. - setSecurityContextRepository(HttpServletRequest, SecurityContextRepository) - Static method in class org.springframework.security.test.web.support.WebTestUtils
-
Sets the
SecurityContextRepositoryfor the specifiedHttpServletRequest. - setupBefore() - Element in annotation interface org.springframework.security.test.context.support.WithAnonymousUser
-
Determines when the
SecurityContextis setup. - setupBefore() - Element in annotation interface org.springframework.security.test.context.support.WithMockUser
-
Determines when the
SecurityContextis setup. - setupBefore() - Element in annotation interface org.springframework.security.test.context.support.WithSecurityContext
-
Determines when the
SecurityContextis setup. - setupBefore() - Element in annotation interface org.springframework.security.test.context.support.WithUserDetails
-
Determines when the
SecurityContextis setup. - springSecurity() - Static method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers
-
Sets up Spring Security's
WebTestClienttest 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 - Enum constant in enum class org.springframework.security.test.context.support.TestExecutionEvent
-
Associated to
TestExecutionListener.beforeTestExecution(TestContext)event. - TEST_METHOD - Enum constant in enum class org.springframework.security.test.context.support.TestExecutionEvent
-
Associated to
TestExecutionListener.beforeTestMethod(TestContext)event. - TestExecutionEvent - Enum Class 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
RequestPostProcessorthat 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
TestSecurityContextHolderis 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
-
ResultMatcherthat 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
SecurityContextthat has aUsernamePasswordAuthenticationTokenfor theAuthentication.getPrincipal()and aUserfor 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
SecurityContextthat has aUsernamePasswordAuthenticationTokenfor theAuthentication.getPrincipal()and a customUserDetailsfor theUsernamePasswordAuthenticationToken.getPrincipal(). - userDetailsServiceBeanName() - Element in annotation interface org.springframework.security.test.context.support.WithUserDetails
-
The bean name for the
UserDetailsServiceto use. - userInfoToken(Consumer<OidcUserInfo.Builder>) - Method in class org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.OidcLoginMutator
-
Use the provided
OidcUserInfowhen constructing the authenticated user - userInfoToken(Consumer<OidcUserInfo.Builder>) - Method in class org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.OidcLoginRequestPostProcessor
-
Use the provided
OidcUserInfowhen constructing the authenticated user - username() - Element in annotation interface 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() - Element in annotation interface org.springframework.security.test.context.support.WithMockUser
-
Convenience mechanism for specifying the username.
- value() - Element in annotation interface org.springframework.security.test.context.support.WithUserDetails
-
The username to look up in the
UserDetailsService - valueOf(String) - Static method in enum class org.springframework.security.test.context.support.TestExecutionEvent
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class org.springframework.security.test.context.support.TestExecutionEvent
-
Returns an array containing the constants of this enum class, 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 Interface in org.springframework.security.test.context.support
-
When used with
WithSecurityContextTestExecutionListenerthis 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 Interface in org.springframework.security.test.context.support
-
When used with
WithSecurityContextTestExecutionListenerthis 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 Interface in org.springframework.security.test.context.support
-
An annotation to determine what
SecurityContextto use. - WithSecurityContextFactory<A extends Annotation> - Interface in org.springframework.security.test.context.support
-
An API that works with WithUserTestExcecutionListener for creating a
SecurityContextthat is populated in theTestSecurityContextHolder. - WithSecurityContextTestExecutionListener - Class in org.springframework.security.test.context.support
-
A
TestExecutionListenerthat will find annotations that are annotated withWithSecurityContexton a test method or at the class level. - WithSecurityContextTestExecutionListener() - Constructor for class org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener
- WithUserDetails - Annotation Interface in org.springframework.security.test.context.support
-
When used with
WithSecurityContextTestExecutionListenerthis annotation can be added to a test method to emulate running with aUserDetailsreturned 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 and Interfaces|All Packages