AzureAD / active-directory-b2c-wordpress-plugin-openidconnect

A plugin for WordPress that allows users to authenticate with Azure AD B2C using OpenID Connect.
MIT License
31 stars 28 forks source link

PHP Fatal error: Uncaught Error: Class 'Crypt_RSA' not found #18

Closed DLozanoNavas closed 6 years ago

DLozanoNavas commented 6 years ago

Hi!

Im happening to be integrating a multisite instalation with AAD under a LAMP Environment. Each time we complete the autentication flow, when redirected to the site, we get a http 500 error. Here's my apache error log:

PHP Fatal error: Uncaught Error: Class 'Crypt_RSA' not found in /var/www/html/wp-content/plugins/active-directory-b2c-wordpress-plugin-openidconnect/class-b2c-token-checker.php:73\nStack trace:\n#0 /var/www/html/wp-content/plugins/active-directory-b2c-wordpress-plugin-openidconnect/class-b2c-token-checker.php(134): B2C_Token_Checker->validate_signature()\n#1 /var/www/html/wp-content/plugins/active-directory-b2c-wordpress-plugin-openidconnect/b2c_authentication.php(99): B2C_Token_Checker->authenticate()\n#2 /var/www/html/wp-includes/class-wp-hook.php(286): b2c_verify_token('')\n#3 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)\n#4 /var/www/html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)\n#5 /var/www/html/wp-settings.php(471): do_action('wp_loaded')\n#6 /var/www/html/wp-config.php(109): require_once('/var/www/html/w...')\n#7 /var/www/html/wp-load.php(37): require_once('/var/www/html/w...')\n#8 /var/www/html/wp-blog-header.php(13): require_once('/var/www/html/w...')\n#9 /var/www/html/index in /var/www/html/wp-content/plugins/active-directory-b2c-wordpress-plugin-openidconnect/class-b2c-token-checker.php on line 73, referer:

It happens to point to the following lines of code:

` // Convert RSA(e,n) format to PEM format $rsa = new Crypt_RSA(); $rsa->setPublicKey('

' . $n . '
            <Exponent>' . $e . '</Exponent>
            </RSAKeyValue>');
        $public_key = $rsa->getPublicKey();`

Any ideas about what might be the problem? I haven't modified any code yet as it seems like a dependecy or configuration issue.

Thank you so much beforehand.

best regards,

Daniel.

DLozanoNavas commented 6 years ago

Just a misconfiguration issue due to multiple versions of php. I'm gonna close this now.