AnsweredAssumed Answered

Possible bug Activiti-rest 5.15

Question asked by yahekia on Jul 18, 2014
Latest reply on Jul 25, 2014 by jbarrez
I have created a CustomRestAuthenticator because for the moment I do not want authentication.


package activiti.extension.rest;

import org.activiti.rest.common.filter.RestAuthenticator;
import org.restlet.Request;

public class CustomRestAuthenticator implements RestAuthenticator {

   public boolean requestRequiresAuthentication(Request request) {
       return false;
    }

   public boolean isRequestAuthorized(Request request) {
       return false;
    }

}



public class NoAuthenticationActivitiRestServicesApplication extends ActivitiRestServicesApplication {
   public NoAuthenticationActivitiRestServicesApplication() {
      super();
      this.setRestAuthenticator(new CustomRestAuthenticator());
   }

   @Override
   public String authenticate(Request request, Response response) {
      if (!request.getClientInfo().isAuthenticated()) {
         authenticator.challenge(response, false);
         return null;
      }
      return "KERMIT!";
   }
}


If I do not override the method authenticate throws a nullpointerexception.

Outcomes