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
RequestMatchers with URI path
variables- Since:
- 6.3
-
Method Summary
Modifier and TypeMethodDescriptionCompares the value of a path variable in the URI with an `Authentication` attribute
-
Method Details
-
equalTo
public AuthorizeHttpRequestsConfigurer<H>.AuthorizationManagerRequestMatcherRegistry equalTo(Function<org.springframework.security.core.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>>.AuthorizationManagerRequestMatcherRegistryfor further customization.
-