on 04-22-2022 2:11 PM
Hello experts,
I am calling workflow instance from Appgyver. I am getting bearer token and I am passing further to HTTP request (component installed from market)
I am passing URL : https://api.workflow-sap.cfapps.eu10.hana.ondemand.com/workflow-service/rest/v1/workflow-instances
And Header part passing as: accessToken is "Bearer <token ID>" I am getting it from previous HTTP request (GET)
Request Body I am preparing as JSON with definitionID and context.
When I execute it, I am getting below error:
Full authentication is required to access this resource
Please guide me further, If I missing anything.
Thanks,
PD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi abhimohpra17 ,
what does the JSON of your workflow service instance parameters currently look like? When you are in your SAP BTP Cockpit, select Services -> Instances and Subscriptions and then select View Parameters for your workflow service instance, as shown in the attached screenshot. Use that JSON, add the missing scope and update your instance. You do not need the same parameters that I posted as an example in my previous answer. You need to adjust your existing service instance parameters.
Best regards,
Jannes
Hi abhimohpra17 ,
are you using your individual user to obtain the JWT token, or the Workflow service instance? Your user requires the role WorkflowInitiator, the service instance requires the scope WORKFLOW_INSTANCE_START.
Did you consider this? If you want to adjust the scopes of your workflow service instance, in the BTP cockpit find the instance and select View Parameters. This should give you a JSON like the following:
{
"applicationScope": "com.sap.workflowmanagement",
"authorities": [
"WORKFLOW_INSTANCE_CANCEL",
"WORKFLOW_INSTANCE_GET",
"WORKFLOW_DEFINITION_GET_MODEL",
"WORKFLOW_INSTANCE_GET_CONTEXT",
"PROCESS_VARIANT_ACTIVATE",
"PROCESS_VARIANT_DELETE",
"FORM_DEFINITION_GET",
"FORM_DEFINITION_UNDEPLOY",
"WORKFLOW_DEFINITION_UNDEPLOY",
"WORKFLOW_INSTANCE_START",
"WORKFLOW_INSTANCES_UPDATE",
"WORKFLOW_INSTANCE_RETRY_RESUME",
"WORKFLOW_DEFINITION_GET_SAMPLE_CONTEXT",
"PROCESS_VARIANT_GET",
"WORKFLOW_INSTANCE_SUSPEND",
"MESSAGE_SEND",
"WORKFLOW_DEFINITION_GET"
],
"dataVisibility": "shared",
"defaultCollectionQueryFilter": "shared"
}
In the authorities array, check if the required scope is there. If not, copy the whole JSON, and for your workflow service instance select the Update option. In the Parameters, paste the JSON and add the missing scopes in the authorities array.
Best regards,
Jannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. I will check the links. I am already triggering successfully from SAP iRPA successfully.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
jannes.s still could not solve the issue. Is it becaue I am not using AppGyver on BTP and directly from Composer Pro and my workflow service instance is created in the BTP tenant?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi abhimohpra17,
I don't think that is the issue. Have you been able to start the workflow manually using a REST client (e.g. Postman or REST Client in SAP Business Application Studio? In that case, you can also check the scopes in your JWT token and see, if they contain the required scope for starting workflows. Have a look at my blog post regarding that topic.
In case you are able to start a workflow via REST client, the issue must be in your AppGyver app. Are you able to check the token that you retrieve within your app? Have you checked this blog post by manuel.namyslo, where he integrates SAP AppGyver and SAP Workflow Management?
Best regards,
Jannes
jannes.s Looks like problem is this parameter.
"applicationScope": "com.sap.workflowmanagement"
I will update further details here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
jannes.s
Thanks for your reply. I am using workflow instance to generate the token. I will try to update the instance and update it here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.