Annotation Type Authorization


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface Authorization
    Use this annotation on a JAX-RS resource to define authorization rules.

    The annotation value contains the class wich implement these rules.

    For instance :

     @GET
     @Authorization(AuthorizationAlwaysTrue.class)
     public String shouldHaveUsedWithoutAuthentication() {
       return "My Public Information";
     }
     
    As you can see in the example, AuthorizationAlwaysTrue will be the authorization class which is in charge of validating authorization.

    An authorization class must only define a authorized method which return a boolean value.

    For instance :
     public class AuthorizationAlwaysTrue {
       public boolean authorized() {
         return true;
       }
     }
     
    Author:
    Arnaud Fonce
    See Also:
    AuthorizationParameter
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class value  
    • Element Detail