simplesamlphp / simplesamlphp/simplesamlphp-module-oidc
ECDSA (ES256) support issues in OIDC module (JWK generation and token verification)
@cicnavi 已经在做这个了。
开始于 2026年4月15日。
- 主要语言
- PHP
- 星标
- 50
- 派生
- 28
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 2
描述
Hi,
I am currently working with the SimpleSAMLphp OIDC module and trying to use ECDSA (ES256) for signing tokens instead of RSA.
I encountered multiple issues that seem to indicate incomplete or inconsistent support for ECDSA.
1. JWK generation issue
In JsonWebKeySetService::prepareProtocolJwkSet(), the implementation uses:
JWKFactory::createFromKeyFile($certificatePath, ...)
However, $certificatePath points to an X.509 certificate file (.crt), not a private key.
According to the JWT Framework documentation, createFromKeyFile() expects a key file, while certificates should be loaded using:
JWKFactory::createFromCertificateFile()
This mismatch causes failures when using ECDSA certificates, while RSA may work by coincidence.
2. Access token verification issue
In BearerTokenValidator, the signer is hardcoded to RSA:
use Lcobucci\JWT\Signer\Rsa\Sha256;
Configuration::forSymmetricSigner(...)
This causes ES256 tokens to fail verification with:
Access token could not be verified
The validator should dynamically select the signer based on the token's alg header (e.g., ES256 vs RS256), and use forAsymmetricSigner().
3. Expected behavior
- The module should support both RS256 and ES256
- JWK generation should correctly use certificate-based loading
- Token verification should dynamically select the correct signer
4. Questions
- Is ECDSA (ES256) officially supported by this module?
- If yes, what is the correct way to configure keys and certificates?
- Should certificates be combined with private keys, or kept separate?
- Is there a recommended key generation procedure?
5. Suggested fixes
- Replace
createFromKeyFile()withcreateFromCertificateFile()when loading certificates - Refactor
BearerTokenValidatorto support multiple algorithms (RS256, ES256)
Any guidance would be greatly appreciated.
Thanks!
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。