simplesamlphp / simplesamlphp/saml2
Cannot use the library with SimpleSAML
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 306
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Description
When trying to generate a SAMLRequest object from an incoming string, the library crashes.
The following is from the Message constructor: https://github.com/simplesamlphp/saml2/blob/master/src/SAML2/Message.php#L143
protected function __construct(string $tagName, DOMElement $xml = null)
{
$this->tagName = $tagName;
$this->id = Utils::getContainer()->generateId();
The container is part of the compat layer with SimpleSAML. The generateId method uses the Random library from SimpleSAML
use SimpleSAML\Utils\HTTP;
use SimpleSAML\Utils\Random;
use SimpleSAML\Utils\System;
use SimpleSAML\Utils\XML;
/**
* {@inheritdoc}
* @return string
*/
public function generateId() : string
{
/** @psalm-suppress UndefinedClass */
return Random::generateID();
}
It's even marked as supressed in Psalm.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start in src/SAML2/Message.php around the Message constructor and trace Utils::getContainer()->generateId() through the SimpleSAML compatibility layer. Reproduce construction of a SAMLRequest from an incoming string and inspect the SimpleSAML Random dependency and Psalm suppression. Done means the library no longer crashes during this construction path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100