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 摘要。