nodeSolidServer / nodeSolidServer/node-solid-server
authorize endpoint fails if public jwk doesn't include .alg
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 1.8k
- フォーク
- 308
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
In the guide for the webid-oidc spec, the "Authorization Request" step describes the encoding of the request paramater.
This includes the public key of a JWK in the key field. I'm using a python tool to generate keys (jwcrypto), but when it generates a public key it doesn't include the "alg" field:
{
"kty": "RSA",
"n": "sezpNr99QA7xMqkNvpZamVDdkiAn_xvuH2H5nTFKYDKILny3a1hp2ULV2nvumiCt9IsxEuvPjAGRQsPMKwDkCjhzO70EoFyb2k2PzwBk_Fd37xNbl4Nrb4W9zK7Vff5vXmtBOFSSzsUdUf52zZMii7RZBcDQSLcmv63qV_NDpvGNOTadth1nbJhzMtQDQWBlWbClI8Z4R0fGgx7yhQvMqOl6vIlFfricBcoe2nopS51uUbsZSNSkTrGHCsBM_ggvVcWzFAvipkSsplEPhvdT1K7oC4Q6yNG6koPPajpxNnEw05Nh5YHIUcmhFKj76rqaCNtwBejYBxeQp2rwnLekKQ",
"e": "AQAB"
}
According to the JWK spec, this parameter is optional: https://tools.ietf.org/html/rfc7517#section-4.4
When generating an authorization request, if the key doesn't include alg, node-solid server returns an error. The exception that causes this is:
normalizedAlgorithm = Error: undefined is not a supported algorithm
at SupportedAlgorithms.normalize (node_modules/@solid/jose/src/algorithms/SupportedAlgorithms.js:75:14)
at Function.importKey (node_modules/@solid/jose/src/jose/JWA.js:89:51)
at Function.importKey (node_modules/@solid/jose/src/jose/JWK.js:31:16)
at AuthenticationRequest.loadCnfKey (node_modules/@solid/oidc-op/src/handlers/AuthenticationRequest.js:212:16)
at node_modules/@solid/oidc-op/src/handlers/AuthenticationRequest.js:176:26
It seems that jose.JWA expects that the alg field exists: https://github.com/solid/jose/blob/71ebf31761002bcb18ce88e739a30a8a6459936f/src/jose/JWA.js#L89
I couldn't find any specific webid-oidc documentation that says that alg is required in this case. It might be nice for node-solid-server to return an explicit error message if a submitted key doesn't include it.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
@solid/oidc-op の AuthenticationRequest.loadCnfKey から始め、@solid/jose/src/jose/JWK.js と JWA.js 内の importKey 呼び出しを追ってください。動作を WebID-OIDC authorization-request guide および RFC 7517 と比較してください。完了条件は、alg が欠落している場合に authorize エンドポイントに対する明示的かつ適切な結果があることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, nodejs
- 領域
- authentication, backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100