diff --git a/packages/ui5-middleware-onelogin/README.md b/packages/ui5-middleware-onelogin/README.md index c370cad5..580210f4 100644 --- a/packages/ui5-middleware-onelogin/README.md +++ b/packages/ui5-middleware-onelogin/README.md @@ -48,12 +48,15 @@ Currently, you can define the following properties: **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 -- ClientCertificate`(optional)`: `object` Configuration for client certificate authentication - - origin: `string` Exact origin that the certificate is valid for. Origin includes https protocol, a hostname and optionally a port. - - certPath: `string` Path to the file with the certificate in PEM format. - - keyPath: `string` Path to the file with the private key in PEM format. - - pfxPath: `string` Path to the PFX or PKCS12 encoded private key and certificate chain. - - passphrase: `string` Passphrase for the private key (PEM or PFX). +**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. You can set the following environment variables in your .env file (remember to add it to your .gitignore): @@ -64,6 +67,7 @@ You can either add the following properties to your .env file, remember to add t - UI5_MIDDLEWARE_ONELOGIN_USERNAME - UI5_MIDDLEWARE_ONELOGIN_PASSWORD - UI5_MIDDLEWARE_ONELOGIN_USE_CERTIFICATE +- UI5_MIDDLEWARE_ONELOGIN_CLIENT_CERTIFICATE - 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 d8a4e480..fe87dfb6 100644 --- a/packages/ui5-middleware-onelogin/lib/cookieGetter.js +++ b/packages/ui5-middleware-onelogin/lib/cookieGetter.js @@ -84,17 +84,29 @@ class CookieGetter { username: process.env.UI5_MIDDLEWARE_ONELOGIN_USERNAME, password: process.env.UI5_MIDDLEWARE_ONELOGIN_PASSWORD, useCertificate: process.env.UI5_MIDDLEWARE_ONELOGIN_USE_CERTIFICATE === "true", - clientCertificates: this.parseJSON(process.env.UI5_MIDDLEWARE_ONELOGIN_CLIENT_CERTIFICATES), + clientCertificate: this.parseJSON(process.env.UI5_MIDDLEWARE_ONELOGIN_CLIENT_CERTIFICATE), 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); - // Check if clientCertificates should be used: useCertificate is true and clientCertificates is defined or clientCertificates contains any certificate - const useClientCertificates = effectiveOptions.configuration.useCertificate || - (effectiveOptions.configuration.clientCertificates && - effectiveOptions.configuration.clientCertificates.some(cert => cert.certPath || cert.cert || cert.keyPath || cert.key || cert.pfxPath || cert.pfx)); + 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; + const useClientCertificates = isUseCertificateEnabled && hasCertificateConfig; if (effectiveOptions.configuration.debug) { log.info("Default options:"); log.info(defaultOptions); @@ -104,7 +116,7 @@ class CookieGetter { log.info(options); log.info("Effective options:"); log.info(effectiveOptions); - log.info(`Using client certificates: ${useClientCertificates}`); + log.info('Using client certificates: ' + String(useClientCertificates)); } const attr = { url: effectiveOptions.configuration.path, @@ -140,8 +152,19 @@ class CookieGetter { try { const browser = yield playwright_chromium_1.chromium.launch(playwrightOpt); const contextOptions = { ignoreHTTPSErrors: true }; - if (useClientCertificates && effectiveOptions.configuration.clientCertificates) { - contextOptions.clientCertificates = effectiveOptions.configuration.clientCertificates; + if (useClientCertificates) { + 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:"); @@ -203,8 +226,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++) { @@ -216,16 +248,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 45fc3190..76aa23af 100644 --- a/packages/ui5-middleware-onelogin/lib/cookieGetter.js.map +++ b/packages/ui5-middleware-onelogin/lib/cookieGetter.js.map @@ -1 +1 @@ -{"version":3,"file":"cookieGetter.js","sourceRoot":"","sources":["../src/cookieGetter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,kEAAkC;AAElC,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACvC,6DAA8D;AAa9D,MAAqB,YAAY;IAChC;;;;OAIG;IACK,cAAc,CAAC,GAAS;QAC/B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBAC9D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/B,CAAC;iBAAM,CAAC;gBACP,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;YAC3C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C;4BAClB,MAAM;wBACP,CAAC;6BAAM,CAAC;4BACP,IAAI,gBAAgB,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;gCAC1C,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,yCAAyC,CAAC,CAAC;4BACjE,CAAC;wBACF,CAAC;oBACF,CAAC;oBACD,IAAI,WAAW,EAAE,CAAC;wBACjB,IAAI,gBAAgB,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;4BAC1C,GAAG,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;wBACjD,CAAC;oBACF,CAAC;gBACF,CAAC;gBAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;gBACxC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,CAAC,GAAG,4FAA4F,CAAC,CAAC;gBACzJ,CAAC;gBACD,OAAO,CAAC,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;AA7OD,+BA6OC"} \ No newline at end of file +{"version":3,"file":"cookieGetter.js","sourceRoot":"","sources":["../src/cookieGetter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,kEAAkC;AAElC,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACvC,6DAA8D;AAa9D,MAAqB,YAAY;IAChC;;;;OAIG;IACK,cAAc,CAAC,GAAS;QAC/B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,IAAI,OAAO,GAAG,CAAC,GAAG,C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O,EAAE,EAAE,CAAC;wBAC9C,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;4BACjB,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;4BAChD,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;wBAC3C,CAAC;wBACD,WAAW,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;wBAC3C,IAAI,CAAC,WAAW,EAAE,CAAC;4BAClB,MAAM;wBACP,CAAC;6BAAM,IAAI,gBAAgB,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;4BACjD,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,yCAAyC,CAAC,CAAC;wBACjE,CAAC;oBACF,CAAC;oBACD,IAAI,WAAW,IAAI,gBAAgB,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;wBACzD,GAAG,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;oBACjD,CAAC;gBACF,CAAC;gBAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;gBACxC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,CAAC,GAAG,4FAA4F,CAAC,CAAC;gBACzJ,CAAC;gBACD,OAAO,CAAC,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;AAvQD,+BAuQC"} \ 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 1ae674e7..f19b7c0a 100644 --- a/packages/ui5-middleware-onelogin/lib/index.js +++ b/packages/ui5-middleware-onelogin/lib/index.js @@ -20,28 +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} ClientCertificate - * @property {string} origin - Exact origin that the certificate is valid for. Origin includes https protocol, a hostname and optionally a port. - * @property {string} [certPath] - Path to the file with the certificate in PEM format. - * @property {Buffer} [cert] - Direct value of the certificate in PEM format. - * @property {string} [keyPath] - Path to the file with the private key in PEM format. - * @property {Buffer} [key] - Direct value of the private key in PEM format. - * @property {string} [pfxPath] - Path to the PFX or PKCS12 encoded private key and certificate chain. - * @property {Buffer} [pfx] - Direct value of the PFX or PKCS12 encoded private key and certificate chain. - * @property {string} [passphrase] - Passphrase for the private key (PEM or PFX). - */ /** * @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 {ClientCertificate[]} [clientCertificates] Array of client certificate configurations + * @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 1c235d50..b6f35b1c 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;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;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;gBA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,KAAK,CAAC,MAAM,CAAC,CAAC;YAC9B,CAAC;YAED,IAAI,SAAS,GAAW,EAAE,CAAC;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/sample/certificate/.envTEMPLATE b/packages/ui5-middleware-onelogin/sample/certificate/.envTEMPLATE index 79ea3b20..22c84521 100644 --- a/packages/ui5-middleware-onelogin/sample/certificate/.envTEMPLATE +++ b/packages/ui5-middleware-onelogin/sample/certificate/.envTEMPLATE @@ -1,4 +1,8 @@ UI5_MIDDLEWARE_ONELOGIN_LOGIN_URL=https://example.com/login UI5_MIDDLEWARE_ONELOGIN_USE_CERTIFICATE=true -UI5_MIDDLEWARE_ONELOGIN_CLIENT_CERTIFICATES=[{"origin": "https://accounts.sap.com","pfxPath": "sap.pfx","passphrase": "XXX"}] +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/ui5.yaml b/packages/ui5-middleware-onelogin/sample/certificate/ui5.yaml index 7e670961..be68af5a 100644 --- a/packages/ui5-middleware-onelogin/sample/certificate/ui5.yaml +++ b/packages/ui5-middleware-onelogin/sample/certificate/ui5.yaml @@ -22,12 +22,11 @@ server: path: https://emea.cockpit.btp.cloud.sap subdirectory: cockpit#/ useCertificate: true - # clientCertificates: - # - origin: "https://accounts.sap.com" - # #certPath: "path/to/cert.pem" - # # cert: Buffer value (not applicable in YAML) - # #keyPath: "path/to/key.pem" - # # key: Buffer value (not applicable in YAML) - # pfxPath: "sap.pfx" - # # pfx: Buffer value (not applicable in YAML) - # #passphrase: "your_passphrase_here" + #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/src/cookieGetter.ts b/packages/ui5-middleware-onelogin/src/cookieGetter.ts index 81301c7f..acfbfa9e 100644 --- a/packages/ui5-middleware-onelogin/src/cookieGetter.ts +++ b/packages/ui5-middleware-onelogin/src/cookieGetter.ts @@ -81,20 +81,32 @@ export default class CookieGetter { username: process.env.UI5_MIDDLEWARE_ONELOGIN_USERNAME, password: process.env.UI5_MIDDLEWARE_ONELOGIN_PASSWORD, useCertificate: process.env.UI5_MIDDLEWARE_ONELOGIN_USE_CERTIFICATE === "true", - clientCertificates: this.parseJSON(process.env.UI5_MIDDLEWARE_ONELOGIN_CLIENT_CERTIFICATES), + clientCertificate: this.parseJSON(process.env.UI5_MIDDLEWARE_ONELOGIN_CLIENT_CERTIFICATE), 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); - // Check if clientCertificates should be used: useCertificate is true and clientCertificates is defined or clientCertificates contains any certificate - const useClientCertificates = - effectiveOptions.configuration.useCertificate || - (effectiveOptions.configuration.clientCertificates && - effectiveOptions.configuration.clientCertificates.some((cert) => cert.certPath || cert.cert || cert.keyPath || cert.key || cert.pfxPath || cert.pfx)); + 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; + const useClientCertificates = isUseCertificateEnabled && hasCertificateConfig; if (effectiveOptions.configuration.debug) { log.info("Default options:"); @@ -105,7 +117,7 @@ export default class CookieGetter { log.info(options); log.info("Effective options:"); log.info(effectiveOptions); - log.info(`Using client certificates: ${useClientCertificates}`); + log.info("Using client certificates: " + String(useClientCertificates)); } const attr: Attributes = { @@ -146,8 +158,19 @@ export default class CookieGetter { const browser = await chromium.launch(playwrightOpt); const contextOptions: any = { ignoreHTTPSErrors: true }; - if (useClientCertificates && effectiveOptions.configuration.clientCertificates) { - contextOptions.clientCertificates = effectiveOptions.configuration.clientCertificates; + if (useClientCertificates) { + 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) { @@ -215,7 +238,15 @@ export default class CookieGetter { } catch (oError) { //This error is fine, it's not locating the No button specifically for Azure } - } else { + // Certificate login without certificate configuration + } else if (isUseCertificateEnabled && hasCertificateConfig) { + // Full certificate login with provided configuration + log.info("Login with certificate configuration. Waiting for page to load..."); + await 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) await page.goto(attr.url, { waitUntil: "networkidle" }); let isLoginPage = true; @@ -227,16 +258,12 @@ export default class CookieGetter { isLoginPage = await this.isLoginPage(page); 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!`); } } diff --git a/packages/ui5-middleware-onelogin/src/index.ts b/packages/ui5-middleware-onelogin/src/index.ts index 9fa9d65e..ff8d7e45 100644 --- a/packages/ui5-middleware-onelogin/src/index.ts +++ b/packages/ui5-middleware-onelogin/src/index.ts @@ -10,32 +10,23 @@ var cookie: string; //First time to make sure we only output the parsed cookie once var firstTime: boolean = true; -// interface cookieFace { -// name: string, -// key: string -// } - -/** - * @typedef {Object} ClientCertificate - * @property {string} origin - Exact origin that the certificate is valid for. Origin includes https protocol, a hostname and optionally a port. - * @property {string} [certPath] - Path to the file with the certificate in PEM format. - * @property {Buffer} [cert] - Direct value of the certificate in PEM format. - * @property {string} [keyPath] - Path to the file with the private key in PEM format. - * @property {Buffer} [key] - Direct value of the private key in PEM format. - * @property {string} [pfxPath] - Path to the PFX or PKCS12 encoded private key and certificate chain. - * @property {Buffer} [pfx] - Direct value of the PFX or PKCS12 encoded private key and certificate chain. - * @property {string} [passphrase] - Passphrase for the private key (PEM or PFX). - */ - /** * @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 {ClientCertificate[]} [clientCertificates] Array of client certificate configurations + * @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 */ + /** * Custom UI5 Server middleware example * diff --git a/packages/ui5-middleware-onelogin/src/types.ts b/packages/ui5-middleware-onelogin/src/types.ts index eee1cd2a..7848b862 100644 --- a/packages/ui5-middleware-onelogin/src/types.ts +++ b/packages/ui5-middleware-onelogin/src/types.ts @@ -7,15 +7,13 @@ export interface Options { useCertificate: boolean; debug?: boolean; query?: unknown; - clientCertificates?: Array<{ - origin: string; - certPath?: string; - cert?: Buffer; - keyPath?: string; - key?: Buffer; - pfxPath?: string; - pfx?: Buffer; - passphrase?: string; - }>; + certificateOrigin?: string; + certificateCertPath?: string; + certificateCert?: Buffer; + certificateKeyPath?: string; + certificateKey?: Buffer; + certificatePfxPath?: string; + certificatePfx?: Buffer; + certificatePassphrase?: string; }; }