Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class AuthorizeHttpRequestsConfigurer

  1. Object
  2. SecurityConfigurer
  3. 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.AuthorizationManagerRequestMatcherRegistryWhere rules are added: pick the requests, then say what they need.
class AuthorizeHttpRequestsConfigurer.AuthorizedUrlWhat the chosen requests need.

Methods

public AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry getRegistry()The rules, to add to.
public void configure(HttpSecurity http)Adds this part’s filters; nothing by default.

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.