Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class AuthorizeHttpRequestsConfigurer
- Object
- SecurityConfigurer
- AuthorizeHttpRequestsConfigurer
The authorization rules of a chain: which requests need what.
http.authorizeHttpRequests(auth -> auth
.requestMatchers("/", "/css/**").permitAll()
.requestMatchers("/admin/**").hasRole("ADMIN")
.requestMatchers(AntPathRequestMatcher.antMatcher("DELETE", "/api/**"))
.hasAuthority("api:delete")
.anyRequest().authenticated());The rules are asked in the order they are written and the first that matches decides. A request no rule matches is denied.
Nested types
class AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry | Where rules are added: pick the requests, then say what they need. |
class AuthorizeHttpRequestsConfigurer.AuthorizedUrl | What the chosen requests need. |
Methods
Inherited methods
Method details
getRegistry
public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry getRegistry()The rules, to add to.
configure
public void configure(HttpSecurity http)Adds this part’s filters; nothing by default.