nodeSolidServer / nodeSolidServer/node-solid-server

ES256 is not a supported algorithm when logging with Inrupt.com (Pod Spaces) account

Offen
#1,602 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
1.8k
Forks
308
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi,

When logging with an Inrupt.com account (a.k.a Pod Spaces, https://signup.pod.inrupt.com/) on several apps, I find the following error in the console: normalizedAlgorithm.importKey is not a function after trying to access other users data which are hosted in a NSS instance

After setting up a local Node Solid Server instance and reproducing the bug, I found the problem occurs here: https://github.com/solid/jose/blob/main/src/jose/JWA.js#L90

I logged around this line to get more info:

Expand to see logs
normalizedAlgorithm: {
  "message": "ES256 is not a supported algorithm"
}

supportedAlgorithms: {
  "sign": {
    "HS256": {
      "params": {
        "name": "HMAC",
        "hash": {
          "name": "SHA-256"
        }
      }
    },
    "HS384": {
      "params": {
        "name": "HMAC",
        "hash": {
          "name": "SHA-384"
        }
      }
    },
    "HS512": {
      "params": {
        "name": "HMAC",
        "hash": {
          "name": "SHA-512"
        }
      }
    },
    "RS256": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-256"
        }
      }
    },
    "RS384": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-384"
        }
      }
    },
    "RS512": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-512"
        }
      }
    },
    "none": {}
  },
  "verify": {
    "HS256": {
      "params": {
        "name": "HMAC",
        "hash": {
          "name": "SHA-256"
        }
      }
    },
    "HS384": {
      "params": {
        "name": "HMAC",
        "hash": {
          "name": "SHA-384"
        }
      }
    },
    "HS512": {
      "params": {
        "name": "HMAC",
        "hash": {
          "name": "SHA-512"
        }
      }
    },
    "RS256": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-256"
        }
      }
    },
    "RS384": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-384"
        }
      }
    },
    "RS512": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-512"
        }
      }
    },
    "none": {}
  },
  "encrypt": {},
  "decrypt": {},
  "importKey": {
    "RS256": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-256"
        }
      }
    },
    "RS384": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-384"
        }
      }
    },
    "RS512": {
      "params": {
        "name": "RSASSA-PKCS1-v1_5",
        "hash": {
          "name": "SHA-512"
        }
      }
    }
  }
}

key.alg:  "ES256"

And this file seems to confirm the absence of E256: https://github.com/solid/jose/blob/main/src/algorithms/index.js#L58

Does it mean that inrupt.com (and I guess other ESS based accounts) are currently not compatible with node-solid-server?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Login-Fehler mit einer lokalen Node Solid Server-Instanz zu reproduzieren, und untersuche anschließend src/jose/JWA.js um Zeile 90 sowie src/algorithms/index.js um Zeile 58. Vergleiche den vom Inrupt.com-Konto gemeldeten ES256-Schlüsselalgorithmus mit den von der jose-Schicht unterstützten Algorithmen; als erledigt gilt die Aufgabe, wenn das Kompatibilitätsproblem behoben oder sein erforderlicher Umfang eindeutig festgestellt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
authentication, backend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.