I'm migrating a UI5 app to serverless. When this runs as an application the destinations protected by xsuaa are accessed normally. But as an HTML5 app it doesn't run.
In the example application I have two destinations, one protected and one not. In the protected I have error 500.
sources
https://github.com/luizcarlospedrosogomes/ui5-cf-serverless


mta.yaml
_schema-version: "3.2"
ID: ui5serverless
version: 1.0.0
build-parameters:
before-all:
- builder: custom
commands:
- npm install
modules:
- name: ui5serverless-destination-content
type: com.sap.application.content
requires:
- name: teste_xsuaa
parameters:
service-key:
name: teste_xsuaa-key
- name: ui5serverless_html_repo_host
parameters:
service-key:
name: ui5serverless_html_repo_host-key
- name: ui5serverless-destination-service
parameters:
content-target: true
parameters:
content:
instance:
destinations:
- Name: ui5serverless_html_repo_host
ServiceInstanceName: ui5serverless_html_repo_host
ServiceKeyName: ui5serverless_html_repo_host-key
sap.cloud.service: basic.service
- Name: teste_xsuaa-uaa
Authentication: OAuth2UserTokenExchange
ServiceInstanceName: teste-xsuaa
ServiceKeyName: teste-xsuaa-key
sap.cloud.service: basic.service
existing_destinations_policy: update
build-parameters:
no-source: true
- name: ui5serverless_ui_deployer
type: com.sap.application.content
path: .
requires:
- name: ui5serverless_html_repo_host
parameters:
content-target: true
build-parameters:
build-result: resources
requires:
- artifacts:
- HTML5Module-content.zip
name: HTML5Module
target-path: resources/
- name: HTML5Module
type: html5
path: HTML5Module
build-parameters:
builder: custom
commands:
- npm run build
supported-platforms: []
resources:
- name: ui5serverless-destination-service
type: org.cloudfoundry.managed-service
parameters:
service: destination
service-name: ui5serverless-destination-service
service-plan: lite
config:
HTML5Runtime_enabled: true
version: 1.0.0
- name: ui5serverless_html_repo_host
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-host
- name: teste_xsuaa
type: org.cloudfoundry.existing-service
parameters:
service-name: teste-xsuaa
{
"welcomeFile": "/index.html",
"routes": [
{
"source": "/backend/(.*)",
"target": "$1",
"authenticationType": "none",
"destination": "backend"
},
{
"source": "/srv-api/(.*)$",
"csrfProtection": false,
"target": "$1",
"authenticationType": "none",
"destination": "srv-api"
},
{
"source": "^/user-api(.*)",
"target": "$1",
"service": "sap-approuter-userapi"
},
{
"source": "^(.*)",
"target": "$1",
"authenticationType": "xsuaa",
"service": "html5-apps-repo-rt"
}
]
}
Request clarification before answering.
configuration destination

conect service connectivity from api, after this generate for mta.yaml of UI

new mta.yaml
ID: ui5serverless
_schema-version: '3.2'
version: 1.0.0
parameters:
enable-parallel-deployments: true
modules:
- name: ui5serverless-deployer
type: com.sap.application.content
path: .
requires:
- name: ui5serverless-repo-host
parameters:
content-target: true
build-parameters:
build-result: resources
requires:
- artifacts:
- HTML5Module-content.zip
name: ui5serverless-HTML5Module
target-path: resources/
- name: ui5serverless-HTML5Module
type: html5
path: HTML5Module
build-parameters:
builder: custom
commands:
- npm i
- npm run build
supported-platforms: []
- name: ui5serverless-destination-content
type: com.sap.application.content
requires:
- name: teste-xsuaa
parameters:
service-key:
name: teste-xsuaa-key
- name: ui5serverless-repo-host
parameters:
service-key:
name: ui5serverless-repo-host-key
- name: teste-xsuaa-apiaccess
parameters:
service-key:
name: teste-xsuaa-apiaccess-key
- name: ui5serverless-destination-service
parameters:
content-target: true
- name: ui5serverless-connectivity-service
parameters:
content:
subaccount:
destinations:
- Name: ui5serverless-repo-host
ServiceInstanceName: ui5serverless-repo-host
ServiceKeyName: ui5serverless-repo-host-key
sap.cloud.service: cloud.service
- Authentication: OAuth2UserTokenExchange
Name: teste-xsuaa
ServiceInstanceName: teste-xsuaa
ServiceKeyName: teste-xsuaa-key
sap.cloud.service: cloud.service
- Authentication: OAuth2ClientCredentials
Name: teste-xsuaa-apiaccess
ServiceInstanceName: teste-xsuaa-apiaccess
ServiceKeyName: teste-xsuaa-apiaccess-key
existing_destinations_policy: update
build-parameters:
no-source: true
resources:
- name: teste-xsuaa
type: org.cloudfoundry.existing-service
parameters:
service-name: teste-xsuaa
- name: teste-xsuaa-apiaccess
type: org.cloudfoundry.managed-service
parameters:
service-plan: apiaccess
service: xsuaa
- name: ui5serverless-destination-service
type: org.cloudfoundry.managed-service
parameters:
service-plan: lite
service: destination
config:
init_data:
subaccount:
existing_destinations_policy: update
destinations:
- Name: ui5serverless-srv
Description: ui5serverless NodeJS backend service
Authentication: NoAuthentication
ProxyType: Internet
HTML5.DynamicDestination: true
HTML5.ForwardAuthToken: true
- name: ui5serverless-connectivity-service
parameters:
service-plan: lite
service: connectivity
type: org.cloudfoundry.managed-service
- name: ui5serverless-repo-host
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-host
- name: ui5serverless-repo-runtime
type: org.cloudfoundry.managed-service
parameters:
service-plan: app-runtime
service: html5-apps-repo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.