Symptom
Error "Failed to log in to your account using interactive OAuth authentication" occurs when logon SAP Datasphere with Command Line(CLI)
If set the log level to 6 with below command:
set LOG_LEVEL=6
datasphere login [options]
In the log file, below information can be found:
error while executing http request Error: self-signed certificate in certificate chain undefined
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."
Environment
SAP Datasphere
Reproducing the Issue
Log in SAP Datasphere with Command Line(CLI) by Passing OAuth Client Information as Options:
datasphere login
--client-id "<id>"
--client-secret "<secret>"
--authorization-url "<url>"
--token-url "<url>"
--host "<url>"
--browser "<browser-name>"
--authorization-flow "<flow>"
Cause
The certificate is invalid.
Resolution
To check whether the issue is caused by the invalid certificate, temporarily disable certificate validation by using below command:
set NODE_TLS_REJECT_UNAUTHORIZED=0
datasphere login [options]
Note:This setting should only be used for debugging and should not be used in productive environments.
If the logon is successful, it indicates the error is caused by the invalid certificate. Add your company’s CA certificate (or other missing or expired certificates) to your Node.js trust store.
- Open the Datasphere tenant URL in Chrome/Edge.
- Click the "View site information" icon andselect "Connection is secure".
- Click "Certificate is valid".
- select the top/root certificate and export it as Base-64 encoded X.509 (.CER).
Save the file with a .pem extension, e.g. C:\certs\corp-root.pem. - set NODE_EXTRA_CA_CERTS=C:\certs\corp-root.pem
datasphere login [options]
See Also
Keywords
sap dsp cli, authentication issues, oauth authentication , KBA , DS-API-CLI , SAP Datasphere Command-Line Interface , DS-SEC , Security (Users, Roles) , Problem
SAP Knowledge Base Article - Public