nodeSolidServer / nodeSolidServer/node-solid-server

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

未關閉
#1,602 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
1.8k
分支
308
PR 合併指標
30 天內沒有已合併 PR

描述

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?

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,使用本機 Node Solid Server 執行個體重現登入失敗,然後檢查 src/jose/JWA.js 第 90 行附近和 src/algorithms/index.js 第 58 行附近。將 Inrupt.com 帳戶回報的 ES256 金鑰演算法與 jose 層支援的演算法進行比較;當相容性問題獲得解決,或其所需範圍獲得明確確定時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
authentication, backend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。