ui5-middleware-cfdestination and a little hack, you can achieve this additional CloudFoundry for your pocket easy-ui5-scaffolded UI5 app).
├── default-env.json
├── uimodule
│ ├── index1.html
│ ├── ui5.yaml
│ └── webapp
# ...
│ ├── index.html
# ...
└── xs-app.json
cfdestination middleware config in ui5.yaml and set both allowLocalDir: true and authenticationMethod: "route"; while you’re at it, notice the port the included approuter is running on (here: 5000) # ...
- name: ui5-middleware-cfdestination
afterMiddleware: compression
configuration:
debug: false
authenticationMethod: "route"
allowServices: true
allowLocalDir: true # <- brand-new config option
port: 5000
destinations: # ...
default-env.json, containing the BTP credential information. It is the prerequisite for any authentication flow with @sap/approuter in the Node.js- and HTML-CloudFoundry services.cf cli plugin to retrieve the file from the BTP (sub-)account of your choice: https://github.com/saphanaacademy/DefaultEnvxs-app.json, the @sap/approuter config file, pointing to a local static asset that is protected by an approuter-based authentication{
"authenticationMethod": "route",
"routes": [
// ...
{
"source": "^/index1.html",
"target": "index1.html",
"localDir": "uimodule",
"authenticationType": "xsuaa"
}
// ...
]
}
approuter to act on a URL http://localhost:$app-router-port/index1.html, map it to the local path uimodule/index1.html, and protect that route via (OAuth2 password grant-type) authentication.index1.html) is not part of the actual UI5 app, but exists standalone. Its’ sole purpose is to trigger the authentication flow and route to the actual UI5 app.http://localhost:8080/index.html).<!-- ... //-->
<head>
<meta http-equiv="refresh" content="0;url=http://localhost:8080/index.html" />
</head>
<!-- ... //-->
ui5 serve as usual for starting the development server - this per default starts the UI5 application on port 8080, with the ui5-middleware-cfdestination running a @sap/approuter under the hood.http://localhost:8080 (which is the default UI5 tooling URL), utilize the @sap/approuter serving the above static HTML "hack" asset by opening http://localhost:5000/index1.html - this will make the approuter pick up the protected resource and cause the client-side redirect to the BTP/IdP configured in your local default-env.json.
meta-tag based redirect will -well- redirect you from http://localhost:5000/index1.html to http://localhost:8080/index.html - the local UI5 app. And that gives you an authenticated BTP session for your local UI5 development runtime!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3143 | |
| 1916 | |
| 1916 | |
| 1213 | |
| 1079 | |
| 757 | |
| 755 | |
| 742 |