cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve ProcessAuthorizationException: User 'XXX' has no permission for calling this method with id 'YYY" on method getProcessInstance?

Former Member
0 Kudos

I'm working with NetWeaver Studio 7.3 SP18 PAT0003, my project is a SOAP service with an operation to retrieve the status of a specific process instance.

My code looks like this:


public String getProcessStatus(String processInstanceID) {

  ProcessInstanceManager processInstanceManager = BPMFactory

  .getProcessInstanceManager();

  Set<ProcessInstance> abstractProcessSet = null;

  ProcessStatus processStatus = null;

  URI bpmUri = null;

  try {

  bpmUri = new URI("bpm://bpm.sap.com/process-instance/" + processInstanceID);

  abstractProcessSet = (Set<ProcessInstance>) processInstanceManager

  .getProcessInstance(bpmUri);

  Iterator<ProcessInstance> itProcess = abstractProcessSet.iterator();

  while (itProcess.hasNext()) {

  ProcessInstance processInstance = itProcess.next();

  processStatus = processInstance.getStatus();

  }

  } catch (Exception e) {

  e.printStackTrace();

  return "URISyntaxException with URI " + bpmUri.toString() + " " + e.getMessage();

  }

  if (processStatus != null) {

  return processStatus.toString();

  } else {

  return "";

  }

}

But when I'm testing with SoapUI or when the service is called from the Visual Composer, the following error is returned:


URISyntaxException with URI bpm://bpm.sap.com/process-instance/41ddb671712911e68c7a000000f9f222 com.sap.glx.process.exception.ProcessAuthorizationException: User 'Guest, ' has no permission for calling this method with id '41ddb671712911e68c7a000000f9f222'

Is Guest user the default user? Do I need to add Authorization info into my URI? How can I pass the correct user with the privileges necessary for getting the process instance into the URI?

Accepted Solutions (1)

Accepted Solutions (1)

christian_santej
Active Participant
0 Kudos

hi,

yes the guest user is the default user. the reason is that as a default value there is no authentication set. you have to define the authentication mechanism first (e.g. basic or logon ticket). when you've deployed your web service application you should be able to configure the authentication via the single service administration (Configuring Individual Web Services - Administration - SAP Library and Locating Web Service - Administration - SAP Library)

regards,

christian

Former Member
0 Kudos

I have a question about this solution, from what I can gather specifying the Authentication in this manner will impact all the processes inside the component, to avoid this, is there a way to make the authentication inside of my method?

What I mean, if I have a Session Bean exposed as a Web Service, and only one of the methods requires an authorized user to be authenticated, can I perform a log on inside this method to ensure all the operations made with BPMFactory to be done?

Answers (0)