~fkooman/php-saml-idp

d85690a162d04153f707ef87cd44a5368476a91d — François Kooman 6 months ago 70328bc
simplify code somewhat
2 files changed, 5 insertions(+), 6 deletions(-)

M composer.lock
M web/well-known.php
M composer.lock => composer.lock +2 -2
@@ 12,7 12,7 @@
            "source": {
                "type": "git",
                "url": "https://git.sr.ht/~fkooman/php-jwt",
                "reference": "0fa26031675438e044308b09fb86486ca95c1516"
                "reference": "4d74b28095b5359df66a47c2061f4d6d9e1b2b17"
            },
            "require": {
                "ext-date": "*",


@@ 50,7 50,7 @@
                "email": "fkooman@tuxed.net",
                "source": "https://git.sr.ht/~fkooman/php-jwt"
            },
            "time": "2024-03-20T12:01:08+00:00"
            "time": "2024-03-20T16:34:53+00:00"
        },
        {
            "name": "fkooman/oauth2-server",

M web/well-known.php => web/well-known.php +3 -4
@@ 39,17 39,16 @@ use fkooman\SAML\IdP\Http\Request;
try {
    $config = Config::fromFile($baseDir . '/config/config.php');

    $supportedAlgList = [];
    // XXX it is insane we need to load all the keys just to get a list of
    // supported algorithms for the discovery
    $publicKeySet = new PublicKeySet();
    foreach (glob($baseDir . '/config/keys/rsa_*.key') as $secretKeyFile) {
        [,$keyId] = explode('_', basename($secretKeyFile, '.key'), 2);
        $secretKey = RS256SecretKey::fromPem(FileIO::read($secretKeyFile), $keyId);
        $supportedAlgList[] = $secretKey->alg();
        $publicKeySet->add($secretKey->publicKey());
    }
    foreach (glob($baseDir . '/config/keys/ed_*.key') as $secretKeyFile) {
        $secretKey = EdDSASecretKey::load(FileIO::read($secretKeyFile));
        $supportedAlgList[] = $secretKey->alg();
        $publicKeySet->add($secretKey->publicKey());
    }



@@ 62,7 61,7 @@ try {
                    $request->getRootUri() . 'openid/authorize',
                    $request->getRootUri() . 'openid/token',
                    $request->getRootUri() . 'openid/userinfo',
                    array_values(array_unique($supportedAlgList)),
                    $publicKeySet->algList(),
                    $request->getRootUri() . 'openid/jwks'
                )
            );