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

public final class AuthorizationFilter

  1. Object
  2. AuthorizationFilter

ImplementsSecurityFilter

Puts the request to the chain’s authorization rules, and throws AccessDeniedException when they refuse it. Last in every chain: what it lets through reaches the application.

Fields

public static final String REQUIRED_AUTHORITIES = "com.codename1.backend.security.requiredAuthorities"The attribute of the request’s SecurityExchange that holds, as a list of text, the authorities any one of which the rule that refused the request would have accepted.

Methods

public HttpServer.Response doFilter(HttpServer.Request request, FilterChain chain) throws ExceptionThe answer to request; null when nothing under the chain routes it, which the server answers 404.

Inherited methods

Field details

REQUIRED_AUTHORITIES

public static final String REQUIRED_AUTHORITIES = "com.codename1.backend.security.requiredAuthorities"
The attribute of the request’s SecurityExchange that holds, as a list of text, the authorities any one of which the rule that refused the request would have accepted. Set when that rule was one about authorities, so that whatever answers the refusal can say what to ask for.

Method details

doFilter

public HttpServer.Response doFilter(HttpServer.Request request, FilterChain chain) throws Exception
The answer to request; null when nothing under the chain routes it, which the server answers 404.

Throws

Exception