1.1.0 • Published 10 months ago

ui5-middleware-xsuaa v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

NPM Version License Build

ui5-middleware-xsuaa

This is a middleware that supports XSUAA authentication to SAP BTP - Cloud Foundry services using either of the following grant types:

  • Authorization Code
  • Client Credentials

Sample Configuration

First, install this library using npm. Also, add ui5-middleware-xsuaa to ui5.dependencies on the package.json file.

Put the following under customMiddleware in ui5.yaml:

    - name: ui5-middleware-xsuaa
      afterMiddleware: compression
      configuration:
        authorizationCodePath: /xsuaa
        backend:
          - path: /api
            pathPrefix: /
            destination: API_Portal_NonProd
          - path: /bpmworkflowruntime
            pathPrefix: /
            service: com.sap.bpm.workflow
            endpoint: workflow_rest_url
          - path: /bpmworkflowodata
            pathPrefix: /
            service: com.sap.bpm.workflow
            endpoint: workflow_odata_url
            grantType: authorizationCode

Make sure all needed services (including a destination service, if destinations are being used) are properly bound on a .env file located in the same folder as the ui5.yaml file¹.

¹ On SAP Business Application Studio, go to View > Find Command... > CF: Bind a service to a locally run application.

TODO

  • Once an authorization has expired, set each backend to "not authorized" and re-authenticate them (if possible)
  • Add optional backend.redirectUri, so that the middleware can set up an endpoint for the XSUAA service to redirect to
1.1.0

10 months ago

1.0.1

1 year ago

1.0.0

1 year ago