Skip to content

Latest commit

 

History

History
63 lines (52 loc) · 2.12 KB

accessing-business-service-data-783809d.md

File metadata and controls

63 lines (52 loc) · 2.12 KB

Accessing Business Service Data

This section describes how the application router accesses the Business Service data.

To access Business Service data, the xs-app.json file should have a route referencing a specific sap.cloud.service or sap.cloud.service.alias via the service attribute. If an endpoint attribute is also modeled, it will be used to get the service URL; otherwise the fallback URL or URI attribute will be used.

Sample Code:

"routes": [
    {
      "source": "^/odata/v2/(.*)$",
      "target": "$1",
      "service": "com.sap.appbasic.country",
      "endpoint": "countryservice"
    },

In order to support JWT token exchange, the login JWT token should contain the uaa.user scope. This requires that the xs-security configuration file contain a role template that references the uaa.user scope.

Sample Code:

{
    "xsappname"   : "simple-approuter",
    "tenant-mode" : "shared",
    "scopes": [
        {
            "name": "uaa.user",
            "description": "UAA"
        },
        {
            "name": "$XSAPPNAME.simple-approuter.admin",
            "description": "Simple approuter administrator"
        }
    ],
    "role-templates": [
        {
            "name": "Token_Exchange",
            "description": "UAA",
            "scope-references": [
                "uaa.user"
            ]
        },
        {
            "name": "simple-approuter-admin",
            "description": "Simple approuter administrator",
            "scope-references": [
                "$XSAPPNAME.simple-approuter.admin"
            ]
        }
    ]
}

Related Information

Integration with Business Services

Accessing Business Service UI