nodeSolidServer / nodeSolidServer/node-solid-server

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

Open
#1,602 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the login failure with a local Node Solid Server instance, then inspect src/jose/JWA.js around line 90 and src/algorithms/index.js around line 58. Compare the ES256 key algorithm reported by the Inrupt.com account with the algorithms supported by the jose layer; done means the compatibility problem is resolved or its required scope is clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.