TheNetworg/oauth2-azure

B2C - Issue when Getting JWT Verification Keys

wuangyalin opened this issue · 1 comments

Hi There,

I am currently trying the experimental feature B2C to my existing system.
I noticed there are two issues in the getJwtVerificationKeys function under the Azure.php file.

  1. The keys returned from my B2C application doesn't include alg attributes so I have to change the code $pkey_object = JWK::parseKey($keyinfo); to $pkey_object = JWK::parseKey($keyinfo, 'RS256'); to default the algorithm.
  2. The $pkey_object returned from the JWK::parseKey method is type of Key so I need to change the code $pkey_array = openssl_pkey_get_details($pkey_object); to $pkey_array = openssl_pkey_get_details($pkey_object->getKeyMaterial());.

After the above change I can get the B2C up and running.

Thanks.

Many thanks. Really helped me to proceed.
+1 to add this change in the next release