Skip to content

Commit

Permalink
feat: working version with one cert
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo committed Nov 5, 2024
1 parent 989239a commit 122e24b
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 97 deletions.
16 changes: 10 additions & 6 deletions packages/ui5-middleware-onelogin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand All @@ -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

Expand Down
62 changes: 45 additions & 17 deletions packages/ui5-middleware-onelogin/lib/cookieGetter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ui5-middleware-onelogin/lib/cookieGetter.js.map

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions packages/ui5-middleware-onelogin/lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ui5-middleware-onelogin/lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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
17 changes: 8 additions & 9 deletions packages/ui5-middleware-onelogin/sample/certificate/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading

0 comments on commit 122e24b

Please sign in to comment.