Package org.springframework.security.config.annotation.web.configurers

# 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 Type
Method
Description
`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` attribute

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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` attribute

For example,

     requestMatchers("/user/{username}").hasVariable("username").equalTo(Authentication::getName));

Parameters:
  `function` - a function to get value from `Authentication`.
Returns:
  the `AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>.AuthorizationManagerRequestMatcherRegistry` for further customization.