+

Search Tips   |   Advanced Search

JACC policy - Security annotations

Annotations are a programming mechanism resulting from the JSR-175 recommendation. An annotation is a standard way to include supported security behaviors while allowing, the source code and configuration files to be generated automatically.

In Java EE 5 and later, The security roles and policies can be defined using annotations as well as within the deployment descriptor. During the installation of the application, the security policies and roles defined using annotations are merged with the security policies and roles defined within the deployment descriptor. This merge is performed by the Annotations Metadata Manager (AMM) facility. When the metadata is merged, the following inheritance rules are followed.

Six security annotations are currently supported. For each annotation, a MergeAction implementation is defined.

The Inherited servlet annotation is a metadata annotation. Do not specify the Inherited annotation in the class. If a subclass does not have security annotation, it automatically inherits security annotation from the parent class. The subclass can overwrite the parent security annotations by specifying its security annotations.


All HTTP methods with no constraints


All HTTP methods with no <auth-constraint> element and confidential TransportGuarantee required


All HTTP methods with all access denied


All HTTP methods except for the GET and POST values with no constraints

For GET, the <auth-constraint> element requires membership in ALL ROLE. For POST, all access is denied.


All HTTP methods except GET, the <auth-constraint> element requires membership in ALL ROLE, and the GET method has no constraints.


All HTTP methods except TRACE, the <auth-constraint> element requires membership in ALL ROLE, and for TRACE, all access is denied.


Related:

  • Authorization providers
  • JACC policy propagation
  • Servlet security dynamic annotations
  • ServletSecurity