## 4.1.4.2.2.9  Integration with Business Services
Application router supports integration with Business Services, which are a flavor of reuse-services.
An SAP Business Service exposes in its binding information in a set of attributes in the VCAP\_SERVICES credentials block that enable application router to serve Business Service UI and/or data.
To access business services, the following applies:
- The Business Service UI must be stored in HTML5 Application Repository to be accessible from an application router.
- The Business Service UI must be defined as "public" to be accessible from an application router in a different space than the one from which the UI was uploaded.
- The Business Service data can be served using two grant types:
| Grant Type         | Description                                                                                                                                                                     |
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| user_token         | The application router performs a token exchange between the login JWT token and the Business Service token, and uses it to trigger a request to the Business Service endpoint. |
| client_credentials | The application router generates a client_credentials token and uses it to trigger a request to the Business Service endpoint.                                                  |
To bind a Business Service instance to the application router, provide the following information in the VCAP\_SERVICES credentials:
| Information               | Mandatory   | Description                                                                                                                                                                                                                                                                                                                           |
|---------------------------|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| sap.cloud.service         | Yes         | Service name as referenced from xs-app.json route and business service prefix, if provided by the Business Service UI.                                                                                                                                                                                                                |
| sap.cloud.service.alia s  | No          | Short service name alias for user friendly URL business serv- ice prefix. Make sure the alias is unique in the context of the application router.                                                                                                                                                                                     |
| endpoints                 | No          | One or more endpoints that can be used to access Business Service data.                                                                                                                                                                                                                                                               |
| html5-apps-repo           | No          | The html5-apps-repo.app_host_id contains one or more html5-apps-repo service instance GUIDs that can be used to retrieve Business Service UIs.                                                                                                                                                                                        |
| saasregistryenabled       | No          | Indicates that this Business Service supports SaaS Regis- try subscription. If provided, the application router returns this Business Service xsappname in the SaaS Registry getDependencies callback.                                                                                                                                |
| grant_type                | No          | The grant type that should be used to trigger requests to the Business Service. Allowed values: user_token (default) or client_credentials .                                                                                                                                                                                          |
| forwardiastoken           | No          | This flag that indicates if, in addition to the exchanged JWT to- ken created by the SAP Authorization and Trust Management Service (xsuaa), the OIDC access token created by Identity Authentication should be forwarded as well. The Identity Authentication token is forwarded in the request header x- ias-token .                |
| forwardiasauthenticati on | No          | This flag indicates that if the login was performed using Identity Authentication, the application router will not ex- change the JWT token created by the SAP Authorization and Trust Management Service (XSUAA). Instead, the OIDC access token created by Identity Authentication will be for- warded in the authorization header. |
| Information                             | Mandatory   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|-----------------------------------------|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| URL.headers.<header- name>:header-value | No          | If you provide this information, the application router prop- agates this attribute as the header to the business service backend. Existing request headers will not be overwritten.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| IASDependencyName                       | No          | The name of the dependency configured between the Identity Authentication application of the application router and the Identity Authentication application of the business service. The dependency enables the application router to consume the API of the business service. If the login process uses Identity Authentication and the busi- ness service binding contains an IASDependencyName con- figuration, the application router uses the dependency name to perform an Identity Authentication token exchange. It then forwards the Identity Authentication token to the business service backend. In cases of multitenancy, configure the de- pendency between the subscribed Identity Authentication ap- plication of the application router and the subscribed Identity Authentication application of the business service. For more details, see Integrating Applications in [SAP Cloud Identity Services. If you use IASDependencyName here, you can't use the HTML5.ForwardAuthToken parameter in the configura- tion of the destination service (seeApplication Routes and |
The value of the endpoints is an object containing the following properties:
| Property   | Type   | Optional   | Default   | Description                                                                                                             |
|------------|--------|------------|-----------|-------------------------------------------------------------------------------------------------------------------------|
| url        | String |            |           | URL to access the Business Service data.                                                                                |
| timeout    | Number | X          | 30000ms   | Positive integer repre- senting the maximum wait time for a re- sponse (in millisec- onds) from the Busi- ness Service. |
The following example shows how to provide the required information. This information should be provided via the onBind hook in the service-broker implementation:
<!-- image -->
```
"countryservice": { "url": https://icf-countriesapp-testservice.cfapps.sap.hana.ondemand.com/odata/v2/countryservice"}, "countryconfig":  { "url": https://icf-countriesapp-testservice.cfapps.sap.hana.ondemand.com/rest/v1/countryconfig", "timeout": 120000 } }, "html5-apps-repo": { "app_host_id": "1bd7c044-6cf4-4c5a-b904-2d3f44cd5569, 1cd7c044-6cf4-4c5a-b904-2d3f44cd54445" }, "saasregistryenabled": true, "grant_type": "user_token" ....
```
## Related Information
```
Accessing Business Service Data [page 492] Accessing Business Service UI [page 493] services [page 473]
```