Reputation: 1085
Implementing SAP xsuaa service with java and deployed, accessing the application URL facing below issue.
Upvotes: 2
Views: 4454
Reputation: 1
I had the same problem while doing this sap tutorial (https://developers.sap.com/tutorials/btp-cf-buildpacks-node-create.html) and it was solved by adding the oath2-configuration to the xs-security.json
:
"oauth2-configuration": {
"token-validity": 604800,
"refresh-token-validity": 2592000,
"redirect-uris": [
"https://<App-router Url>/**"
]
},
Upvotes: 0
Reputation: 1085
Posting this problem solution as I faced and resolved.
Case 1: If you are using BAS (Business Application Studio) and deploying through mta file, make sure you have added forwardAuthToken: true for xsuaa service associated application instance.
in the mta file add the below properties.
requires:
- name: my_xsuaa
- name: MY_API
group: destinations
properties:
name: MY_API
url: '~{url}'
forwardAuthToken: true
If it is not working after that then check your xs-security.json file
"oauth2-configuration": {
"token-validity": 604800,
"refresh-token-validity": 2592000,
"redirect-uris":[
"https://*.<your_uri>/login/callback"
]
}
Case 2: If deploying a java application below properties should be set in the menifest.yml file.
env:
SESSION_TIMEOUT: 30
destinations: >
[{
"name":"MY_API",
"url" :"<you_java_application_uri>",
"forwardAuthToken": true
}
]
Upvotes: 3