Thomas Gerbet (tgerbet)2022-05-02 11:01 https://github.com/wikimedia/mediawiki-extensions-TuleapIntegration/commit/a0ca760f29ff9259532d9f7de7695a4e891d7a96 Status changed from New to ClosedClose date set to 2022-05-02
Thomas Gerbet (tgerbet)2022-03-31 10:54 Hello, I'm a bit confused with the way the keys used to validate the signature are parsed: foreach ( $keys['keys'] as $keyData ) { if ( $keyData['kty'] !== 'RSA' ) { // Dont know how to handle other types continue; } $modulus = sodium_base642bin( $keyData['n'], SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ); $exponent = sodium_base642bin( $keyData['e'], SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ); $key = PublicKeyLoader::loadPublicKey( [ 'e' => new BigInteger( $exponent, 256 ), 'n' => new BigInteger( $modulus, 256 ), ] ); $res[$keyData['kid']] = new Key( $key->toString( 'pkcs8' ), $keyData['alg'] ); } https://github.com/wikimedia/mediawiki-extensions-TuleapIntegration/blob/3002953f2cc0cf47a58ec759a0bf1f835c4ea5aa/src/Provider/Tuleap.php#L168-L181 I'm a bit concerned with using phpseclib3 when we could use the openssl_ primitives to avoid relying on a userland RSA implementation. I took a look at the Firebase JWT package and there is a JWK::parseKeySet method that we could use to achieve that.
Thomas Gerbet (tgerbet)2022-03-08 14:44 Yep, it is only supposed to be present since it is the unique ID of the user you authenticate.
Dejan Savuljesku (dsavuljesku)2022-03-08 14:27 All done except verifying sub claim. Not sure how to do that. As far as i see, sub is the resource owner ID, but we dont get then until after the AT has been verified, right?
Dejan Savuljesku (dsavuljesku)2022-03-07 10:32 Yes, actually i fogot to finish this, checking for 200 was just a stub
Manuel Vacelet (vaceletm)2022-03-07 10:27Original Submission Show diff Switch to markup diff Something went wrong, the follow up content couldn't be loaded Only formatting have been changed, you should switch to markup to see the changes