Class AuthorizeHttpRequestsConfigurer.AuthorizedUrl
- java.lang.Object
-
- org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer.AuthorizedUrl
-
- Direct Known Subclasses:
AuthorizeHttpRequestsConfigurer.MvcMatchersAuthorizedUrl
- Enclosing class:
- AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder<H>>
public class AuthorizeHttpRequestsConfigurer.AuthorizedUrl extends java.lang.ObjectAn object that allows configuring theAuthorizationManagerforRequestMatchers.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryaccess(org.springframework.security.authorization.AuthorizationManager<org.springframework.security.web.access.intercept.RequestAuthorizationContext> manager)Allows specifying a customAuthorizationManager.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryanonymous()Specify that URLs are allowed by anonymous users.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryauthenticated()Specify that URLs are allowed by any authenticated user.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistrydenyAll()Specify that URLs are not allowed by anyone.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfullyAuthenticated()Specify that URLs are allowed by users who have authenticated and were not "remembered".protected java.util.List<? extends org.springframework.security.web.util.matcher.RequestMatcher>getMatchers()AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryhasAnyAuthority(java.lang.String... authorities)Specifies that a user requires one of many authorities.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryhasAnyRole(java.lang.String... roles)Specifies that a user requires one of many roles.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryhasAuthority(java.lang.String authority)Specifies a user requires an authority.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryhasRole(java.lang.String role)Specifies a user requires a role.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistrypermitAll()Specify that URLs are allowed by anyone.AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryrememberMe()Specify that URLs are allowed by users that have been remembered.
-
-
-
Method Detail
-
getMatchers
protected java.util.List<? extends org.springframework.security.web.util.matcher.RequestMatcher> getMatchers()
-
permitAll
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry permitAll()
Specify that URLs are allowed by anyone.- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customizations
-
denyAll
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry denyAll()
Specify that URLs are not allowed by anyone.- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customizations
-
hasRole
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry hasRole(java.lang.String role)
Specifies a user requires a role.- Parameters:
role- the role that should be required which is prepended with ROLE_ automatically (i.e. USER, ADMIN, etc). It should not start with ROLE_- Returns:
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customizations
-
hasAnyRole
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry hasAnyRole(java.lang.String... roles)
Specifies that a user requires one of many roles.- Parameters:
roles- the roles that the user should have at least one of (i.e. ADMIN, USER, etc). Each role should not start with ROLE_ since it is automatically prepended already- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customizations
-
hasAuthority
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry hasAuthority(java.lang.String authority)
Specifies a user requires an authority.- Parameters:
authority- the authority that should be required- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customizations
-
hasAnyAuthority
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry hasAnyAuthority(java.lang.String... authorities)
Specifies that a user requires one of many authorities.- Parameters:
authorities- the authorities that the user should have at least one of (i.e. ROLE_USER, ROLE_ADMIN, etc)- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customizations
-
authenticated
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry authenticated()
Specify that URLs are allowed by any authenticated user.- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customizations
-
fullyAuthenticated
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry fullyAuthenticated()
Specify that URLs are allowed by users who have authenticated and were not "remembered".- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customization - Since:
- 5.8
- See Also:
RememberMeConfigurer
-
rememberMe
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry rememberMe()
Specify that URLs are allowed by users that have been remembered.- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customization - Since:
- 5.8
- See Also:
RememberMeConfigurer
-
anonymous
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry anonymous()
Specify that URLs are allowed by anonymous users.- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customization - Since:
- 5.8
-
access
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry access(org.springframework.security.authorization.AuthorizationManager<org.springframework.security.web.access.intercept.RequestAuthorizationContext> manager)
Allows specifying a customAuthorizationManager.- Parameters:
manager- theAuthorizationManagerto use- Returns:
- the
AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistryfor further customizations
-
-