Class AuthorizeHttpRequestsConfigurer.AuthorizedUrl.AuthorizedUrlVariable
java.lang.Object
org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer.AuthorizedUrl.AuthorizedUrlVariable
- Enclosing class:
- AuthorizeHttpRequestsConfigurer.AuthorizedUrl
public final class AuthorizeHttpRequestsConfigurer.AuthorizedUrl.AuthorizedUrlVariable
extends Object
An object that allows configuring
RequestMatcher
s with URI path
variables- Since:
- 6.3
-
Method Summary
Modifier and TypeMethodDescriptionequalTo
(Function<Authentication, String> function) Compares the value of a path variable in the URI with an `Authentication` attribute
-
Method Details
-
equalTo
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry equalTo(Function<Authentication, String> function) Compares the value of a path variable in the URI with an `Authentication` attributeFor example,
requestMatchers("/user/{username}").hasVariable("username").equalTo(Authentication::getName));
- Parameters:
function
- a function to get value fromAuthentication
.- Returns:
- the
AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry
for further customization.
-