ECDSA (ES256) support issues in OIDC module (JWK generation and token verification)
@cicnavi is already working on this.
Since Apr 15, 2026.
Assessment
This issue has not been assessed yet.
Description
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!
- Dominant language
- PHP
- Stars
- 51
- Forks
- 27
- Avg merge
- 12m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simplesamlphp/simplesamlphp-module-oidc
-
prepared
Difficulty 5/5 Over a week Newbie friendliness 35/100
simplesamlphp/simplesamlphp-module-oidc#360 · 2 comments ·
-
prepared
Difficulty 3/5 1-2 days Newbie friendliness 65/100
simplesamlphp/simplesamlphp-module-oidc#358 · 2 comments ·
-
Encryption key can only be stringMay be free again @cicnavi claimed this 271 days ago, and no pull request is open. Openenhancement prepared
simplesamlphp/simplesamlphp-module-oidc#332 · 1 comment · 1 assignee ·
-
ReflectionParameter::getClass() is deprecatedMay be free again @cicnavi claimed this 286 days ago, and no pull request is open. Openprepared
simplesamlphp/simplesamlphp-module-oidc#327 · 2 comments · 1 assignee ·
-
Missing support for multiple signature algorithmsMay be free again @cicnavi claimed this 321 days ago, and no pull request is open. Openenhancement prepared
simplesamlphp/simplesamlphp-module-oidc#324 · 1 comment · 1 assignee ·
All issues in simplesamlphp/simplesamlphp-module-oidc
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Adyen/adyen-magento2#3453 ·
Maintainers usually reply within 8 days
-
component/media domain/discovery
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
simplesamlphp/simplesamlphp#2695 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day