[COMPASS-7605] [OIDC] Improve Issuer.discover error message Created: 30/Jan/24  Updated: 31/Jan/24

Status: Open
Project: Compass
Component/s: UI / UX
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Anna Henningsen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: needs-prioritization
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Developer Tools
Story Points: 2

 Description   

The openid-client package we use to perform OIDC protocol interactions mostly forwards HTTPS errors directly to the caller. Node.js HTTPS errors, however, can be fairly unspecific; e.g.:

> require('openid-client').Issuer.discover('https://self-signed.badssl.com')
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 35,
  [Symbol(trigger_async_id_symbol)]: 6
}
> Uncaught Error: self-signed certificate
    [...] {
  code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
}

As a quick win, we could wrap the error message from Issuer.discover in https://github.com/mongodb-js/oidc-plugin/blob/14de2c8c18f74c3a6eb892fa180850afc9b83460/src/plugin.ts#L339 so that it indicates that the error happened while looking up issuer metadata (and what the issuer URI in question is), and include the issuer URI in the log file when starting an OIDC authentication attempt.


Generated at Wed Feb 07 22:47:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.