Annotation Type AuthorizationParameter


  • @Repeatable(AuthorizationParameters.class)
    @Retention(RUNTIME)
    @Target(METHOD)
    public @interface AuthorizationParameter
    An annotation to give access the JAX-RS resource parameters to the authorization class define with Authorization.

    For instance, you can define a JAX-RS resource as below :

     @GET
     @Path("authorizationWithPathParam/{param}")
     @Authorization(AuthorizationWithParam.class)
     @AuthorizationParameter("param")
     public String authorizationWithPathParam(@PathParam("param") String param) {
       return "my value";
     }
     

    Then the authorization class should have a setter for param parameter.

     public class AuthorizationWithParam {
       private String param;
     
       public boolean authorized() {
         return param != null ∧∧ param.equals("good value");
       }
     
       public void setParam(String param) {
         this.param = param;
       }
     }
     
    Author:
    Arnaud Fonce
    See Also:
    Authorization
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value