diff --git a/packages/ui5-middleware-onelogin/README.md b/packages/ui5-middleware-onelogin/README.md index eb5f9c225..bdd29c250 100644 --- a/packages/ui5-middleware-onelogin/README.md +++ b/packages/ui5-middleware-onelogin/README.md @@ -27,26 +27,60 @@ npm install ui5-middleware-onelogin --save-dev ## Configuration options (in `$yourapp/ui5.yaml`) -Currently you can define the properties in the configuration (see below) or the following environment variables are used. +You can define the properties either in the configuration (YAML file) or using environment variables. The order of precedence is: -- path: `string` either the url or the hostname and port of the SAP system -- subdirectory`(optional)`: `string` the subdirectory that is appended to the path, defaults to the fiori launchpad at /sap/bc/ui2/flp -- username`(optional)`: `string` Username to be used to login to the launchpad -- password`(optional)`: `string`Password used to login -- useCertificate`(optional)`: `boolean` use a certificate to login instead of username and password -- debug`(optional)`: `boolean` true will open up the playwright browser so you can see what's going on +1. YAML file configuration +2. Environment variables +3. Default configuration + +**Important:** When configuring `ClientCertificate`, you must define all its properties either in the YAML file or in environment variables. Mixing definitions between YAML and environment variables for `ClientCertificate` is not supported. + +Currently, you can define the following properties: + +- **path**: `string` either the url or the hostname and port of the SAP system +- **subdirectory**`(optional)`: `string` the subdirectory that is appended to the path, defaults to the fiori launchpad at /sap/bc/ui2/flp +- **username**`(optional)`: `string` Username to be used to login to the launchpad +- **password**`(optional)`: `string` Password used to login +- **useCertificate**`(optional)`: `boolean` use a certificate to login instead of username and password +- **debug**`(optional)`: `boolean` true will open up the playwright browser so you can see what's going on **NB1:** If you choose to use the certificate login then check the property AutoSelectCertificateForUrls in chrome://policy if it holds the url pattern for your system. [Playwright](https://github.com/microsoft/playwright/issues/1799) has an issue to handle the certificate prompt. Another workaround is to set debug and useCertificate to true in the configuration and press ok when the prompt opens **NB2:** If your system does not host a fiori launchpad, you will have to adjust the subdirectory to point to a different login protected page. In the case of a MII java stack that hosts an OData service, try setting subdirectory to XMII/PropertyAccessServlet?Mode=List -You can either add the following properties to your .env file, remember to add that to your .gitignore +### **Certificate properties:** + +- **certificateOrigin**`(optional)`: `string` Exact origin that the certificate is valid for. Origin includes https protocol, a hostname and optionally a port. +- **certificateCertPath**`(optional)`: `string` Path to the file with the certificate in PEM format. +- **certificateKeyPath**`(optional)`: `string` Path to the file with the private key in PEM format. +- **certificatePfxPath**`(optional)`: `string` Path to the PFX or PKCS12 encoded private key and certificate chain. +- **certificatePassphrase**`(optional)`: `string` Passphrase for the private key (PEM or PFX). + +Those properties are only work when useCertificate is set to true. + +### **Using SAP Passport:** + +You can use SAP Passport certificates to login without having to provide a username and password. +Get your certificate from [SAP Passport](https://support.sap.com/en/my-support/single-sign-on-passports.html). +Here you download a **pfx** file with a passphrase. You can move the certificate to the root of your project and set the `certificatePfxPath` to the file name. +Add the passphrase to the **.env** file with the property `UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_PASSPHRASE`. + +### **Using environment variables:** + +You can set the following environment variables in your **.env** file (remember to add it to your .gitignore): + +You can either add the following properties to your **.env** file, remember to add that to your .gitignore - UI5_MIDDLEWARE_ONELOGIN_LOGIN_URL or UI5_MIDDLEWARE_SIMPLE_PROXY_BASEURI - UI5_MIDDLEWARE_ONELOGIN_LOGIN_SUBDIRECTORY - UI5_MIDDLEWARE_ONELOGIN_USERNAME - UI5_MIDDLEWARE_ONELOGIN_PASSWORD - UI5_MIDDLEWARE_ONELOGIN_USE_CERTIFICATE +- UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_ORIGIN +- UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_CERT_PATH +- UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_KEY_PATH +- UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_PFX_PATH +- UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_PASSPHRASE - UI5_MIDDLEWARE_ONELOGIN_QUERY or UI5_MIDDLEWARE_SIMPLE_PROXY_QUERY - UI5_MIDDLEWARE_ONELOGIN_DEBUG diff --git a/packages/ui5-middleware-onelogin/lib/cookieGetter.js b/packages/ui5-middleware-onelogin/lib/cookieGetter.js index 95a427fb4..4c632ad50 100644 --- a/packages/ui5-middleware-onelogin/lib/cookieGetter.js +++ b/packages/ui5-middleware-onelogin/lib/cookieGetter.js @@ -86,26 +86,50 @@ class CookieGetter { useCertificate: process.env.UI5_MIDDLEWARE_ONELOGIN_USE_CERTIFICATE === "true", debug: process.env.UI5_MIDDLEWARE_ONELOGIN_DEBUG === "true", query: this.parseJSON(process.env.UI5_MIDDLEWARE_ONELOGIN_QUERY), + certificateOrigin: process.env.UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_ORIGIN, + certificateCertPath: process.env.UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_CERT_PATH, + certificateCert: this.parseJSON(process.env.UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_CERT), + certificateKeyPath: process.env.UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_KEY_PATH, + certificateKey: this.parseJSON(process.env.UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_KEY), + certificatePfxPath: process.env.UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_PFX_PATH, + certificatePfx: this.parseJSON(process.env.UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_PFX), + certificatePassphrase: process.env.UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_PASSPHRASE, }, }); const effectiveOptions = Object.assign({}, options); effectiveOptions.configuration = Object.assign({}, defaultOptions.configuration, envOptions.configuration, options.configuration); + const isUseCertificateEnabled = effectiveOptions.configuration.useCertificate; + const hasCertificateConfig = effectiveOptions.configuration.certificateCertPath || + effectiveOptions.configuration.certificateCert || + effectiveOptions.configuration.certificateKeyPath || + effectiveOptions.configuration.certificateKey || + effectiveOptions.configuration.certificatePfxPath || + effectiveOptions.configuration.certificatePfx; if (effectiveOptions.configuration.debug) { + const sanitizePassphrase = (obj) => { + var _a; + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + if (!((_a = obj === null || obj === void 0 ? void 0 : obj.configuration) === null || _a === void 0 ? void 0 : _a.certificatePassphrase)) + return obj; + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return Object.assign(Object.assign({}, obj), { configuration: Object.assign(Object.assign({}, obj.configuration), { certificatePassphrase: "***" }) }); + }; log.info("Default options:"); - log.info(defaultOptions); + log.info(sanitizePassphrase(defaultOptions)); log.info("Env options:"); - log.info(envOptions); + log.info(sanitizePassphrase(envOptions)); log.info("Yaml options:"); - log.info(options); + log.info(sanitizePassphrase(options)); log.info("Effective options:"); - log.info(effectiveOptions); + log.info(sanitizePassphrase(effectiveOptions)); + log.info("Using client certificates: " + String(isUseCertificateEnabled && hasCertificateConfig)); } const attr = { url: effectiveOptions.configuration.path, username: effectiveOptions.configuration.username, password: effectiveOptions.configuration.password, }; - if ((!attr.username || !attr.password) && !effectiveOptions.configuration.useCertificate) { + if ((!attr.username || !attr.password) && !(isUseCertificateEnabled && hasCertificateConfig)) { log.warn("No credentials provided. Please answer the following prompts"); if (!attr.username) { attr.username = yield prompt("Username: "); @@ -119,6 +143,7 @@ class CookieGetter { const url = new URL(`${urlWithTrailingSlash}${effectiveOptions.configuration.subdirectory}`); const query = effectiveOptions.configuration.query; if (query) { + // @ts-ignore Object.keys(query).forEach((key) => url.searchParams.append(key, query[key])); } attr.url = url.href; @@ -132,9 +157,31 @@ class CookieGetter { }; try { const browser = yield playwright_chromium_1.chromium.launch(playwrightOpt); - const context = yield browser.newContext({ ignoreHTTPSErrors: true }); + const contextOptions = { ignoreHTTPSErrors: true }; + if (isUseCertificateEnabled && hasCertificateConfig) { + contextOptions.clientCertificates = [ + { + origin: effectiveOptions.configuration.certificateOrigin, + certPath: effectiveOptions.configuration.certificateCertPath, + cert: effectiveOptions.configuration.certificateCert, + keyPath: effectiveOptions.configuration.certificateKeyPath, + key: effectiveOptions.configuration.certificateKey, + pfxPath: effectiveOptions.configuration.certificatePfxPath, + pfx: effectiveOptions.configuration.certificatePfx, + passphrase: effectiveOptions.configuration.certificatePassphrase, + }, + ]; + } + if (effectiveOptions.configuration.debug) { + log.info("Client certificates configuration:"); + // Create a copy of certificates config without the passphrase for logging + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return + const certificatesForLogging = contextOptions.clientCertificates.map((cert) => (Object.assign(Object.assign({}, cert), { passphrase: cert.passphrase ? "***" : undefined }))); + log.info(certificatesForLogging); + } + const context = yield browser.newContext(contextOptions); const page = yield context.newPage(); - if (!effectiveOptions.configuration.useCertificate) { + if (!(isUseCertificateEnabled && hasCertificateConfig)) { yield page.goto(attr.url, { waitUntil: "domcontentloaded" }); const elem = yield this.getUserInput(page); const password = page.locator('input[type="password"]'); @@ -188,8 +235,17 @@ class CookieGetter { catch (oError) { //This error is fine, it's not locating the No button specifically for Azure } + // Certificate login without certificate configuration } - else { + else if (isUseCertificateEnabled && hasCertificateConfig) { + // Full certificate login with provided configuration + log.info("Login with certificate configuration. Waiting for page to load..."); + yield page.goto(attr.url, { waitUntil: "networkidle" }); + // Add more robust certificate handling here if needed + } + else if (isUseCertificateEnabled && !hasCertificateConfig) { + // Certificate login without explicit configuration + // (might be using system certificates) yield page.goto(attr.url, { waitUntil: "networkidle" }); let isLoginPage = true; for (let attempt = 0; attempt < 3; attempt++) { @@ -201,16 +257,12 @@ class CookieGetter { if (!isLoginPage) { break; } - else { - if (effectiveOptions.configuration.debug) { - log.info(`"${attr.url}" looks like a login page, reloading...`); - } + else if (effectiveOptions.configuration.debug) { + log.info(`"${attr.url}" looks like a login page, reloading...`); } } - if (isLoginPage) { - if (effectiveOptions.configuration.debug) { - log.info(`Couldn't login using a certificate!`); - } + if (isLoginPage && effectiveOptions.configuration.debug) { + log.info(`Couldn't login using a certificate!`); } } const cookies = yield context.cookies(); diff --git a/packages/ui5-middleware-onelogin/lib/cookieGetter.js.map b/packages/ui5-middleware-onelogin/lib/cookieGetter.js.map index 3856d46b3..208313b00 100644 --- a/packages/ui5-middleware-onelogin/lib/cookieGetter.js.map +++ b/packages/ui5-middleware-onelogin/lib/cookieGetter.js.map @@ -1 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AAC,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAChC,CAAC;YAAC,OAAO,MAAM,EAAE,CAAC;gBACjB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAClB,MAAM,MAAM,CAAC;YACd,CAAC;QACF,CAAC;KAAA;CACD;AAxRD,+BAwRC"} \ No newline at end of file diff --git a/packages/ui5-middleware-onelogin/lib/index.js b/packages/ui5-middleware-onelogin/lib/index.js index fca452153..f19b7c0a2 100644 --- a/packages/ui5-middleware-onelogin/lib/index.js +++ b/packages/ui5-middleware-onelogin/lib/index.js @@ -20,16 +20,20 @@ dotenv_1.default.config(); var cookie; //First time to make sure we only output the parsed cookie once var firstTime = true; -// interface cookieFace { -// name: string, -// key: string -// } /** * @typedef {Object} [configuration] configuration * @property {string} path - The path to use => env:UI5_MIDDLEWARE_ONELOGIN_LOGIN_URL * @property {string} [username] the username => env:UI5_MIDDLEWARE_ONELOGIN_USERNAME * @property {string|yo} [password] the password => env:UI5_MIDDLEWARE_ONELOGIN_PASSWORD * @property {boolean|yo} [useCertificate] use certificate login instead of username/password + * @property {string} [certificateOrigin] - Exact origin that the certificate is valid for. Origin includes https protocol, a hostname and optionally a port. + * @property {string} [certificateCertPath] - Path to the file with the certificate in PEM format. + * @property {Buffer} [certificateCert] - Direct value of the certificate in PEM format. + * @property {string} [certificateKeyPath] - Path to the file with the private key in PEM format. + * @property {Buffer} [certificateKey] - Direct value of the private key in PEM format. + * @property {string} [certificatePfxPath] - Path to the PFX or PKCS12 encoded private key and certificate chain. + * @property {Buffer} [certificatePfx] - Direct value of the PFX or PKCS12 encoded private key and certificate chain. + * @property {string} [certificatePassphrase] - Passphrase for the private key (PEM or PFX). * @property {boolean|yo} [debug] see output */ /** diff --git a/packages/ui5-middleware-onelogin/lib/index.js.map b/packages/ui5-middleware-onelogin/lib/index.js.map index cc1dcf318..b6f35b1c5 100644 --- a/packages/ui5-middleware-onelogin/lib/index.js.map +++ b/packages/ui5-middleware-onelogin/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,mCAAmC;AACnC,oDAA4B;AAC5B,kEAA0C;AAE1C,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,IAAI,MAAc,CAAC;AAEnB,+DAA+D;AAC/D,IAAI,SAAS,GAAY,IAAI,CAAC;AAE9B,yBAAyB;AACzB,gBAAgB;AAChB,cAAc;AACd,IAAI;AAEJ;;;;;;;GAOG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,GAAG,UAAU,EAAE,GAAG,EAAE,OAAO,EAAkC;IAC1E,sCAAsC;IACtC,OAAO,UAAgB,GAAQ,EAAE,GAAQ,EAAE,IAAS;;YACnD,IAAI,OAAO,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mCAAmC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;gBACvI,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBACnC,IAAI,EAAE,CAAC;gBACP,OAAO;YACR,CAAC;iBAAM,IAAI,CAAC,MAAM,EAAE,CAAC;gBACpB,GAAG,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;gBACtC,IAAI,CAAC;oBACJ,MAAM,SAAS,GAAG,MAAM,IAAI,sBAAY,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;oBACnE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;oBAChC,MAAM,GAAG,SAAS,CAAC;gBACpB,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBAChB,GAAG,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC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;YAE3B,OAAO;iBACL,MAAM,CAAC,CAAC,UAAe,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;iBACvE,OAAO,CAAC,CAAC,MAAW,EAAE,EAAE;gBACxB,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC;gBACzB,OAAO,MAAM,CAAC,OAAO,CAAC;gBACtB,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE;oBACrC,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,WAAW;oBACjC,QAAQ,EAAE,IAAI,EAAE,+CAA+C;oBAC/D,MAAM,EAAE,KAAK,EAAE,wCAAwC;iBACvD,CAAC,CAAC;gBACH,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,IAAA,kBAAS,EAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,kCAAO,MAAM,KAAE,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAG,EAAE,IAAI,CAAC,CAAC;YACnH,CAAC,CAAC,CAAC;YACJ,IAAI,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,SAAS,EAAE,CAAC;gBAC9C,GAAG,CAAC,IAAI,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAC;gBAC1C,SAAS,GAAG,KAAK,CAAC;YACnB,CAAC;YACD,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;YAE/B,IAAI,EAAE,CAAC;QACR,CAAC;KAAA,CAAC;AACH,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/ui5-middleware-onelogin/package.json b/packages/ui5-middleware-onelogin/package.json index 603caa34a..64e2448fe 100644 --- a/packages/ui5-middleware-onelogin/package.json +++ b/packages/ui5-middleware-onelogin/package.json @@ -17,6 +17,8 @@ "Fiori" ], "scripts": { + "build": "tsc", + "watch": "tsc --watch", "lint": "eslint src", "test:onelogin": "npx playwright test" }, diff --git a/packages/ui5-middleware-onelogin/sample/certificate/.envTEMPLATE b/packages/ui5-middleware-onelogin/sample/certificate/.envTEMPLATE new file mode 100644 index 000000000..22c845211 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/.envTEMPLATE @@ -0,0 +1,8 @@ +UI5_MIDDLEWARE_ONELOGIN_LOGIN_URL=https://example.com/login +UI5_MIDDLEWARE_ONELOGIN_USE_CERTIFICATE=true +UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_ORIGIN=https://accounts.sap.com +#UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_CERT_PATH=path/to/cert.pem +#UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_KEY_PATH=path/to/key.pem +UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_PFX_PATH=sap.pfx +UI5_MIDDLEWARE_ONELOGIN_CERTIFICATE_PASSPHRASE=your_passphrase_here +UI5_MIDDLEWARE_ONELOGIN_DEBUG=true diff --git a/packages/ui5-middleware-onelogin/sample/certificate/.gitignore b/packages/ui5-middleware-onelogin/sample/certificate/.gitignore new file mode 100644 index 000000000..16826c006 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/.gitignore @@ -0,0 +1,18 @@ +# build results +dist +coverage + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Dependency directories +node_modules/ + +.DS_Store +.env +tmp/ +sap.pfx diff --git a/packages/ui5-middleware-onelogin/sample/certificate/package.json b/packages/ui5-middleware-onelogin/sample/certificate/package.json new file mode 100644 index 000000000..08e176c14 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/package.json @@ -0,0 +1,21 @@ +{ + "name": "certificate", + "version": "1.0.0", + "description": "UI5 Application: certificate", + "author": "„marianfoo“", + "license": "Apache-2.0", + "scripts": { + "clean": "rimraf dist coverage", + "build": "ui5 build --clean-dest", + "build:opt": "ui5 build self-contained --clean-dest --all", + "start": "ui5 serve --port 8080 -o index.html", + "start:silent": "ui5 serve --port 8080 ", + "start-cdn": "ui5 serve --port 8080 -o index-cdn.html", + "start:dist": "npm start -- --config ui5-dist.yaml", + "start:dist-cdn": "npm run start-cdn -- --config ui5-dist.yaml" + }, + "devDependencies": { + "@ui5/cli": "^4.0.6", + "ui5-middleware-onelogin": "file:../.." + } +} diff --git a/packages/ui5-middleware-onelogin/sample/certificate/ui5.yaml b/packages/ui5-middleware-onelogin/sample/certificate/ui5.yaml new file mode 100644 index 000000000..be68af5a0 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/ui5.yaml @@ -0,0 +1,32 @@ +specVersion: "4.0" +metadata: + name: certificate +type: application +framework: + name: OpenUI5 + version: "1.120.20" + libraries: + - name: sap.m + - name: sap.ui.core + - name: themelib_sap_horizon +builder: + resources: + excludes: + - "test/e2e/**" +server: + customMiddleware: + - name: ui5-middleware-onelogin + afterMiddleware: compression + configuration: + debug: true + path: https://emea.cockpit.btp.cloud.sap + subdirectory: cockpit#/ + useCertificate: true + #certificateOrigin: "https://accounts.sap.com" + #certificateCertPath: "path/to/cert.pem" + #certificateCert: # Buffer value (not applicable in YAML) + #certificateKeyPath: "path/to/key.pem" + #certificateKey: # Buffer value (not applicable in YAML) + #certificatePfxPath: "sap.pfx" + #certificatePfx: # Buffer value (not applicable in YAML) + #certificatePassphrase: "your_passphrase_here" diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/Component.js b/packages/ui5-middleware-onelogin/sample/certificate/webapp/Component.js new file mode 100644 index 000000000..76ea45387 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/Component.js @@ -0,0 +1,40 @@ +sap.ui.define(["sap/ui/core/UIComponent", "sap/ui/Device", "./model/models"], function (UIComponent, Device, models) { + "use strict"; + + return UIComponent.extend("certificate.Component", { + metadata: { + manifest: "json", + }, + init: function () { + // call the base component's init function + UIComponent.prototype.init.call(this); // create the views based on the url/hash + + // create the device model + this.setModel(models.createDeviceModel(), "device"); + + // create the views based on the url/hash + this.getRouter().initialize(); + }, + /** + * This method can be called to determine whether the sapUiSizeCompact or sapUiSizeCozy + * design mode class should be set, which influences the size appearance of some controls. + * @public + * @returns {string} css class, either 'sapUiSizeCompact' or 'sapUiSizeCozy' - or an empty string if no css class should be set + */ + getContentDensityClass: function () { + if (this.contentDensityClass === undefined) { + // check whether FLP has already set the content density class; do nothing in this case + if (document.body.classList.contains("sapUiSizeCozy") || document.body.classList.contains("sapUiSizeCompact")) { + this.contentDensityClass = ""; + } else if (!Device.support.touch) { + // apply "compact" mode if touch is not supported + this.contentDensityClass = "sapUiSizeCompact"; + } else { + // "cozy" in case of touch support; default for most sap.m controls, but needed for desktop-first controls like sap.ui.table.Table + this.contentDensityClass = "sapUiSizeCozy"; + } + } + return this.contentDensityClass; + }, + }); +}); diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/App.controller.js b/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/App.controller.js new file mode 100644 index 000000000..ca278d882 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/App.controller.js @@ -0,0 +1,10 @@ +sap.ui.define(["./BaseController"], function (BaseController) { + "use strict"; + + return BaseController.extend("certificate.controller.App", { + onInit: function () { + // apply content density mode to root view + this.getView().addStyleClass(this.getOwnerComponent().getContentDensityClass()); + }, + }); +}); diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/BaseController.js b/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/BaseController.js new file mode 100644 index 000000000..67c9bc083 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/BaseController.js @@ -0,0 +1,75 @@ +sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/UIComponent", "sap/ui/core/routing/History"], function (Controller, UIComponent, History) { + "use strict"; + + return Controller.extend("certificate.controller.BaseController", { + /** + * Convenience method for accessing the component of the controller's view. + * @returns {sap.ui.core.Component} The component of the controller's view + */ + getOwnerComponent: function () { + return Controller.prototype.getOwnerComponent.call(this); + }, + + /** + * Convenience method to get the components' router instance. + * @returns {sap.m.routing.Router} The router instance + */ + getRouter: function () { + return UIComponent.getRouterFor(this); + }, + + /** + * Convenience method for getting the i18n resource bundle of the component. + * @returns {sap.base.i18n.ResourceBundle} The i18n resource bundle of the component + */ + getResourceBundle: function () { + const oModel = this.getOwnerComponent().getModel("i18n"); + return oModel.getResourceBundle(); + }, + + /** + * Convenience method for getting the view model by name in every controller of the application. + * @param {string} [sName] The model name + * @returns {sap.ui.model.Model} The model instance + */ + getModel: function (sName) { + return this.getView().getModel(sName); + }, + + /** + * Convenience method for setting the view model in every controller of the application. + * @param {sap.ui.model.Model} oModel The model instance + * @param {string} [sName] The model name + * @returns {sap.ui.core.mvc.Controller} The current base controller instance + */ + setModel: function (oModel, sName) { + this.getView().setModel(oModel, sName); + return this; + }, + + /** + * Convenience method for triggering the navigation to a specific target. + * @public + * @param {string} sName Target name + * @param {object} [oParameters] Navigation parameters + * @param {boolean} [bReplace] Defines if the hash should be replaced (no browser history entry) or set (browser history entry) + */ + navTo: function (sName, oParameters, bReplace) { + this.getRouter().navTo(sName, oParameters, undefined, bReplace); + }, + + /** + * Convenience event handler for navigating back. + * It there is a history entry we go one step back in the browser history + * If not, it will replace the current entry of the browser history with the main route. + */ + onNavBack: function () { + const sPreviousHash = History.getInstance().getPreviousHash(); + if (sPreviousHash !== undefined) { + window.history.go(-1); + } else { + this.getRouter().navTo("main", {}, undefined, true); + } + }, + }); +}); diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/Main.controller.js b/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/Main.controller.js new file mode 100644 index 000000000..8372e777f --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/controller/Main.controller.js @@ -0,0 +1,9 @@ +sap.ui.define(["./BaseController", "sap/m/MessageBox"], function (BaseController, MessageBox) { + "use strict"; + + return BaseController.extend("certificate.controller.Main", { + sayHello: function () { + MessageBox.show("Hello World!"); + }, + }); +}); diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n.properties b/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n.properties new file mode 100644 index 000000000..7ebc2fbaf --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n.properties @@ -0,0 +1,3 @@ +appTitle=certificate +appDescription=UI5 Application certificate +btnText=Say Hello diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n_de.properties b/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n_de.properties new file mode 100644 index 000000000..90d424886 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n_de.properties @@ -0,0 +1,3 @@ +appTitle=certificate +appDescription=UI5 Application certificate +btnText=Sag Hallo diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n_en.properties b/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n_en.properties new file mode 100644 index 000000000..7ebc2fbaf --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/i18n/i18n_en.properties @@ -0,0 +1,3 @@ +appTitle=certificate +appDescription=UI5 Application certificate +btnText=Say Hello diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/index-cdn.html b/packages/ui5-middleware-onelogin/sample/certificate/webapp/index-cdn.html new file mode 100644 index 000000000..f4c52fb80 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/index-cdn.html @@ -0,0 +1,31 @@ + + + + + + + + + + UI5 Application: certificate + + + + + +
+ + diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/index.html b/packages/ui5-middleware-onelogin/sample/certificate/webapp/index.html new file mode 100644 index 000000000..85acce556 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/index.html @@ -0,0 +1,30 @@ + + + + + + + + + UI5 Application: certificate + + + + + +
+ + diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/manifest.json b/packages/ui5-middleware-onelogin/sample/certificate/webapp/manifest.json new file mode 100644 index 000000000..3e91f2063 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/manifest.json @@ -0,0 +1,81 @@ +{ + "_version": "1.12.0", + + "sap.app": { + "id": "certificate", + "type": "application", + "i18n": "i18n/i18n.properties", + "title": "{{appTitle}}", + "description": "{{appDescription}}", + "applicationVersion": { + "version": "${version}" + } + }, + + "sap.ui": { + "technology": "UI5", + "icons": {}, + "deviceTypes": { + "desktop": true, + "tablet": true, + "phone": true + } + }, + + "sap.ui5": { + "rootView": { + "viewName": "certificate.view.App", + "type": "XML", + "async": true, + "id": "app" + }, + + "dependencies": { + "minUI5Version": "1.120.20", + "libs": { + "sap.ui.core": {}, + "sap.m": {} + } + }, + + "handleValidation": true, + + "contentDensities": { + "compact": true, + "cozy": true + }, + + "models": { + "i18n": { + "type": "sap.ui.model.resource.ResourceModel", + "settings": { + "bundleName": "certificate.i18n.i18n" + } + } + }, + + "routing": { + "config": { + "routerClass": "sap.m.routing.Router", + "viewType": "XML", + "viewPath": "certificate.view", + "controlId": "app", + "controlAggregation": "pages", + "async": true + }, + "routes": [ + { + "pattern": "", + "name": "main", + "target": "main" + } + ], + "targets": { + "main": { + "viewId": "main", + "viewName": "Main" + } + } + } + } +} diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/model/formatter.js b/packages/ui5-middleware-onelogin/sample/certificate/webapp/model/formatter.js new file mode 100644 index 000000000..61fc2d616 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/model/formatter.js @@ -0,0 +1,9 @@ +sap.ui.define(function () { + "use strict"; + + return { + formatValue: function (value) { + return value && value.toUpperCase(); + }, + }; +}); diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/model/models.js b/packages/ui5-middleware-onelogin/sample/certificate/webapp/model/models.js new file mode 100644 index 000000000..2b3e7def6 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/model/models.js @@ -0,0 +1,11 @@ +sap.ui.define(["sap/ui/model/json/JSONModel", "sap/ui/model/BindingMode", "sap/ui/Device"], function (JSONModel, BindingMode, Device) { + "use strict"; + + return { + createDeviceModel: function () { + const oModel = new JSONModel(Device); + oModel.setDefaultBindingMode(BindingMode.OneWay); + return oModel; + }, + }; +}); diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/view/App.view.xml b/packages/ui5-middleware-onelogin/sample/certificate/webapp/view/App.view.xml new file mode 100644 index 000000000..25df23128 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/view/App.view.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/ui5-middleware-onelogin/sample/certificate/webapp/view/Main.view.xml b/packages/ui5-middleware-onelogin/sample/certificate/webapp/view/Main.view.xml new file mode 100644 index 000000000..3732fd043 --- /dev/null +++ b/packages/ui5-middleware-onelogin/sample/certificate/webapp/view/Main.view.xml @@ -0,0 +1,13 @@ + + + + + +