cancel
Showing results for 
Search instead for 
Did you mean: 

401 Unauthorized - Build Apps Unable to Access BTP Destination API

depratihari
Explorer
0 Kudos
536

Hi Experts,

I am facing strange error while calling SAP Build process automation from SAP Build apps using SAP Build apps published library API integration in which i have published my build process automation API trigger.

Performed all steps correctly in steps provided in "https://help.sap.com/docs/build-apps/service-guide/sap-build-process-automation?q=service+key".

When i debugged the issue i found the error as below

"{
"status": 401,
"statusText": "Unauthorized",
"headers": {
"cache-control": "no-cache, no-store, max-age=0, must-revalidate",
"expires": "0",
"pragma": "no-cache",
"referrer-policy": "no-referrer",
"www-authenticate": "Bearer error=\"invalid_token\", error_description=\"Jwt token with allowed audiences [destination-xsappname!b62, uaa, openid, xs_account, sb-clone850d95a770d2421f962aa985e61e9bda!b107153|destination-xsappname!b62] matches none of these: [xsuaa!b120249]\", error_uri=\"https://tools.ietf.org/html/rfc6750#section-3.1\"",
"x-content-type-options": "nosniff",
"x-frame-options": "DENY",
"x-vcap-request-id": "70a2438e-ac45-4a98-4696-cf9c0fa58649",
"x-xss-protection": "0",
"date": "Sun, 12 Jan 2025 09:18:37 GMT",
"strict-transport-security": "max-age=31536000; includeSubDomains; preload;",
"connection": "close"
},
"responseText": ""
}

Any help will be appreciated.

 

View Entire Topic
Dinu
Active Contributor

Configure the destination sap_process_automation_service_user_access as (exactly as) described in Configure SAP Build Process Automation Destinations | SAP Help Portal

Notes:

1. Authentication Type

Authentication: OAuth2JWTBearer

2. Don't add additional property

forwardAuthToken: true

 

depratihari
Explorer
0 Kudos
Thanks Dinu for your Inputs. I changed Authentication Type to "OAuth2JWTBearer" also I found I missed one step of adding the Destination in the Destination section of SAP Build control Tower. Its working as expected now
VaradBhagwat
Explorer
0 Kudos

Hi, I'm getting 401 unauthorized error while calling Build Workflow API trigger from my SAPUI5 application (both locally running or from Build workzone). The URL called is "https://spa-api-gateway-bpi-us-prod.cfapps.us10.hana.ondemand.com/workflow/rest/v1/workflow-instance..." to get X-CSRF token. My Workflow created as per tutorial https://developers.sap.com/tutorials/spa-academy-run-salesorderprocess.html#fb19e3da-bee0-4477-afc4-... Can you suggest what is the possible resolution for this issue.

What is the correct URL to trigger the BPA workflow API from the SAP UI5 app. And what is the correct method to call the API ?

1. Calling SBPA Workflow API to trigger process from SAPUI5 app

VaradBhagwat_0-1738034344958.png

2. 401 unauthorized error -

VaradBhagwat_1-1738034345408.png

3. CORS issue while testing UI5 app locally or from Build Workzone

VaradBhagwat_2-1738034345407.png