Plugin Directory

Changeset 2710778


Ignore:
Timestamp:
04/17/2022 03:41:34 PM (4 years ago)
Author:
authress
Message:

Update to version 0.2.64 from GitHub

Location:
authress
Files:
2 deleted
19 edited
1 copied

Legend:

Unmodified
Added
Removed
  • authress/assets/readme.txt

    r2690735 r2710778  
    55Requires PHP: 7.4
    66Tested up to: 5.9.1
    7 Stable tag: 0.2.53
     7Stable tag: 0.2.64
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
     
    77771. Enable your users to login with their email for any domain.
    7878
     79== How to customize this plugin ==
     80
     81This plugin provides extension points to make it easier to configure it exactly as you need. Check out the full docs:
     82* [SSO Login customizations](https://github.com/Authress/wordpress-sso-login/blob/main/docs/customizations.md)
     83
    7984== Changelog ==
    8085
  • authress/tags/0.2.64/Authress_Sso_Login.php

    r2690735 r2710778  
    44    Plugin URI:   https://wordpress.org/plugins/authress
    55    Description:  Upgrades the WordPress login to support SSO Login.
    6     Version:      0.2.53
     6    Version:      0.2.64
    77    Author:       Authress
    88    Author URI:   https://authress.io
     
    1111*/
    1212
    13 define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.53' );
     13define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.64' );
    1414
    1515define( 'AUTHRESS_SSO_LOGIN_PLUGIN_FILE', __FILE__ );
     
    146146 */
    147147function authress_sso_login_render_lock_form( $html ) {
    148     authress_debug_log('authress_sso_login_render_lock_form');
     148    authress_debug_log('=> authress_sso_login_render_lock_form');
    149149
    150150    ob_start();
     
    155155    }
    156156
    157     authress_debug_log('Falling back to wp login form');
     157    authress_debug_log('=> Falling back to wp login form');
    158158    return $html;
    159159}
     
    257257
    258258function authress_sso_login_initial_setup_init() {
    259     authress_debug_log('authress_sso_login_initial_setup_init');
     259    authress_debug_log('=> authress_sso_login_initial_setup_init');
    260260    return false;
    261261}
     
    263263
    264264function authress_sso_login_init() {
    265     authress_debug_log('authress_sso_login_init()');
     265    authress_debug_log('=> authress_sso_login_init()');
    266266    $router = new Authress_Sso_Login_Routes( Authress_Sso_Login_Options::Instance() );
    267267    $router->setup_rewrites();
     
    270270
    271271function check_for_user_logged_in() {
    272     authress_debug_log('check_for_user_logged_in');
     272    authress_debug_log('=> check_for_user_logged_in');
    273273   
    274274    if (!is_user_logged_in() && isset($_REQUEST['nonce'])) {
     
    281281        // if (is_user_logged_in()) {
    282282        //  wp_safe_redirect(home_url());
    283         //  authress_debug_log('User successfully now logged in during handler');
     283        //  authress_debug_log('=> User successfully now logged in during handler');
    284284        // } else {
    285         //  authress_debug_log('User NOT logged in during handler');
     285        //  authress_debug_log('=> User NOT logged in during handler');
    286286        // }
    287287        // wp_safe_redirect();
     
    310310
    311311function authress_sso_login_init_admin_menu() {
    312     authress_debug_log('authress_sso_login_init_admin_menu');
     312    authress_debug_log('=> authress_sso_login_init_admin_menu');
    313313    if (is_admin() && !empty($_REQUEST['page']) && 'authress_help' === $_REQUEST['page']) {
    314314        wp_safe_redirect( admin_url( 'admin.php?page=authress_configuration#help' ), 301 );
     
    359359
    360360function authress_sso_login_init_admin() {
    361     authress_debug_log('authress_sso_login_init_admin');
     361    authress_debug_log('=> authress_sso_login_init_admin');
    362362    $options = Authress_Sso_Login_Options::Instance();
    363363    $routes  = new Authress_Sso_Login_Routes( $options );
     
    368368
    369369function authress_sso_login_admin_enqueue_scripts() {
    370     authress_debug_log('authress_sso_login_admin_enqueue_scripts');
     370    authress_debug_log('=> authress_sso_login_admin_enqueue_scripts');
    371371    $options = Authress_Sso_Login_Options::Instance();
    372372    $routes  = new Authress_Sso_Login_Routes( $options );
     
    383383
    384384function authress_sso_login_profile_enqueue_scripts() {
    385     authress_debug_log('authress_sso_login_profile_enqueue_scripts');
     385    authress_debug_log('=> authress_sso_login_profile_enqueue_scripts');
    386386    global $pagenow;
    387387
     
    425425    $users_repo    = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() );
    426426    $login_manager = new Authress_Sso_Login_LoginManager( $users_repo, Authress_Sso_Login_Options::Instance() );
    427     authress_debug_log('authress_wp_page_loaded');
     427    authress_debug_log('=> authress_wp_page_loaded');
    428428    return $login_manager->init_authress();
    429429}
     
    439439    $users_repo    = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() );
    440440    $login_manager = new Authress_Sso_Login_LoginManager( $users_repo, Authress_Sso_Login_Options::Instance() );
    441     authress_debug_log('authress_wp_login_widget_loaded');
     441    authress_debug_log('=> authress_wp_login_widget_loaded');
    442442    return $login_manager->login_auto();
    443443}
  • authress/tags/0.2.64/lib/Authress_Sso_Login_LoginManager.php

    r2690711 r2710778  
    5454     */
    5555    public function login_auto() {
    56         authress_debug_log('login_auto');
     56        authress_debug_log('=> login_auto');
    5757        // Not processing form data, just using a redirect parameter if present.
    5858        // phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification
     
    9191     */
    9292    public function init_authress() {
    93         authress_debug_log('init_authress');
     93        authress_debug_log('=> init_authress');
    9494
    9595        // Not an Authress login process or settings are not configured to allow logins.
     
    112112        if ( is_user_logged_in() ) {
    113113            // wp_safe_redirect( $this->a0_options->get( 'default_login_redirection' ) );
    114             authress_debug_log('user_logged_in: returning without further setup');
     114            authress_debug_log('    returning without further setup');
    115115            return true;
    116116        }
     
    145145     */
    146146    public function handle_login_redirect() {
    147         authress_debug_log('handle_login_redirect');
     147        authress_debug_log('=> handle_login_redirect');
    148148        $access_token = sanitize_text_field(isset($_COOKIE['authorization']) ? wp_unslash($_COOKIE['authorization']) : '');
    149149        if (!isset($_COOKIE['authorization']) && isset($_REQUEST['access_token'])) {
     
    158158        }
    159159
    160         authress_debug_log('access_token: ' . $access_token);
    161         authress_debug_log('id_token:' . $id_token);
     160        authress_debug_log('    access_token: ' . $access_token);
     161        authress_debug_log('    id_token:' . $id_token);
    162162
    163163        if (empty($id_token) || empty($access_token)) {
    164             authress_debug_log('No tokens set, user is not logged in');
     164            authress_debug_log('    No tokens set, user is not logged in');
    165165            return false;
    166166        }
     
    171171
    172172        if ( $this->login_user($userinfo) ) {
    173             authress_debug_log('Tokens set, user is logged in');
     173            authress_debug_log('    Tokens set, user is logged in');
    174174            return true;
    175175        }
     
    192192
    193193        if ( ! is_null( $user ) ) {
    194             authress_debug_log('Existing user: updating');
     194            authress_debug_log('    Existing user: updating');
    195195            // User exists so log them in.
    196196            if ( isset( $userinfo->email ) && $user->data->user_email !== $userinfo->email ) {
     
    225225        }
    226226        try {
    227             authress_debug_log('New user: creating.');
     227            authress_debug_log('    New user: creating.');
    228228            $creator = new Authress_Sso_Login_UsersRepo( $this->a0_options );
    229229            $user_id = $creator->create( $userinfo);
     
    250250     */
    251251    private function do_login( $user) {
    252         authress_debug_log('LoginManager.do_login');
     252        authress_debug_log('=> LoginManager.do_login');
    253253        $remember_users_session = $this->a0_options->get( 'remember_users_session', true);
    254254
     
    318318     */
    319319    protected function die_on_login( $msg = '', $code = 0 ) {
    320         authress_debug_log('Ending User Session.');
     320        authress_debug_log('    Ending User Session: ' . $msg . ' ' . $code);
    321321
    322322        // Log the user out completely.
     
    349349     */
    350350    private function decode_id_token( $id_token ) {
     351        authress_debug_log('=> decode_id_token()');
    351352        $expectedIss = $this->a0_options->get_auth_domain();
    352353
     
    364365
    365366        $jwk = null;
    366         $signer = new Signer\Eddsa();
     367        $signer = null;
    367368        foreach ( $keys as $element ) {
    368             if ( $keyId === $element->kid ) {
    369                 $jwk = json_decode(wp_json_encode($element), true);
    370                 if ($element->alg === 'RS512') {
    371                     $signer = new Signer\Rsa\Sha512();
    372                 }
     369            if ( $keyId !== $element->kid ) {
     370                continue;
    373371            }
    374         }
    375 
    376         if ($jwk === null) {
     372
     373            if ($element->alg === 'RS512') {
     374                $signer = new Signer\Rsa\Sha512();
     375                $jwkConverter = new CoderCat\JWKToPEM\JWKConverter();
     376                $jwk = InMemory::plainText($jwkConverter->toPEM(json_decode(wp_json_encode($element), true)));
     377            } else {
     378                $signer = new Signer\Eddsa();
     379                $jwk = InMemory::plainText(base64_decode(strtr($element->x, '-_', '+/')), true);
     380            }
     381        }
     382
     383        if (empty($jwk) || $jwk === null) {
     384            authress_debug_log('   No $JWK found: ' . wp_json_encode($keys));
    377385            throw new Authress_Sso_Login_InvalidIdTokenException();
    378386        }
    379 
    380         $jwkConverter = new CoderCat\JWKToPEM\JWKConverter();       
    381387
    382388        $config->setValidationConstraints(new Constraint\LooseValidAt(SystemClock::fromUTC()));
    383389        $config->setValidationConstraints(new Constraint\IssuedBy($expectedIss));
    384         $config->setValidationConstraints(new Constraint\SignedWith($signer, InMemory::plainText($jwkConverter->toPEM($jwk))));
     390        $config->setValidationConstraints(new Constraint\SignedWith($signer, $jwk));
    385391        $constraints = $config->validationConstraints();
     392
    386393        try {
    387394            $config->validator()->assert($token, ...$constraints);
     
    389396            return $userObject;
    390397        } catch (RequiredConstraintsViolated $e) {
     398            authress_debug_log('   Invalid user authentication token. Error:' . $e->violations());
    391399            Authress_Sso_Login_ErrorLog::insert_error( __METHOD__, __( 'Invalid user authentication token:', 'wp-authress' ) . $e->violations());
     400            throw new Authress_Sso_Login_InvalidIdTokenException($e);
     401        } catch (Exception $e) {
     402            authress_debug_log('   Invalid user authentication token. Error:' . $e->getMessage());
     403            Authress_Sso_Login_ErrorLog::insert_error( __METHOD__, __( 'Failed to verify authentication token:', 'wp-authress' ) . $e->getMessage());
    392404            throw new Authress_Sso_Login_InvalidIdTokenException($e);
    393405        }
  • authress/tags/0.2.64/readme.txt

    r2690735 r2710778  
    55Requires PHP: 7.4
    66Tested up to: 5.9.1
    7 Stable tag: 0.2.53
     7Stable tag: 0.2.64
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
     
    77771. Enable your users to login with their email for any domain.
    7878
     79== How to customize this plugin ==
     80
     81This plugin provides extension points to make it easier to configure it exactly as you need. Check out the full docs:
     82* [SSO Login customizations](https://github.com/Authress/wordpress-sso-login/blob/main/docs/customizations.md)
     83
    7984== Changelog ==
    8085
  • authress/tags/0.2.64/vendor/autoload.php

    r2690735 r2710778  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit2b0eb5c91ca35dcfd0eb17b49510abdd::getLoader();
     7return ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd::getLoader();
  • authress/tags/0.2.64/vendor/composer/InstalledVersions.php

    r2690735 r2710778  
    3131    array (
    3232    ),
    33     'reference' => '887bb439e965d138b19569d28fdd7ec6a345c567',
     33    'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d',
    3434    'name' => 'authress/wordpress-plugin.php',
    3535  ),
     
    4343      array (
    4444      ),
    45       'reference' => '887bb439e965d138b19569d28fdd7ec6a345c567',
     45      'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d',
    4646    ),
    4747    'codercat/jwk-to-pem' =>
  • authress/tags/0.2.64/vendor/composer/autoload_real.php

    r2690735 r2710778  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit2b0eb5c91ca35dcfd0eb17b49510abdd
     5class ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit2b0eb5c91ca35dcfd0eb17b49510abdd', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit2b0eb5c91ca35dcfd0eb17b49510abdd', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInitcd79ff3a427c493345a770421550b0dd::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
     
    5454
    5555        if ($useStaticLoader) {
    56             $includeFiles = Composer\Autoload\ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$files;
     56            $includeFiles = Composer\Autoload\ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$files;
    5757        } else {
    5858            $includeFiles = require __DIR__ . '/autoload_files.php';
    5959        }
    6060        foreach ($includeFiles as $fileIdentifier => $file) {
    61             composerRequire2b0eb5c91ca35dcfd0eb17b49510abdd($fileIdentifier, $file);
     61            composerRequirecd79ff3a427c493345a770421550b0dd($fileIdentifier, $file);
    6262        }
    6363
     
    6666}
    6767
    68 function composerRequire2b0eb5c91ca35dcfd0eb17b49510abdd($fileIdentifier, $file)
     68function composerRequirecd79ff3a427c493345a770421550b0dd($fileIdentifier, $file)
    6969{
    7070    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • authress/tags/0.2.64/vendor/composer/autoload_static.php

    r2690735 r2710778  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd
     7class ComposerStaticInitcd79ff3a427c493345a770421550b0dd
    88{
    99    public static $files = array (
     
    631631    {
    632632        return \Closure::bind(function () use ($loader) {
    633             $loader->prefixLengthsPsr4 = ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$prefixLengthsPsr4;
    634             $loader->prefixDirsPsr4 = ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$prefixDirsPsr4;
    635             $loader->fallbackDirsPsr4 = ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$fallbackDirsPsr4;
    636             $loader->classMap = ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$classMap;
     633            $loader->prefixLengthsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$prefixLengthsPsr4;
     634            $loader->prefixDirsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$prefixDirsPsr4;
     635            $loader->fallbackDirsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$fallbackDirsPsr4;
     636            $loader->classMap = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$classMap;
    637637
    638638        }, null, ClassLoader::class);
  • authress/tags/0.2.64/vendor/composer/installed.php

    r2690735 r2710778  
    77    array (
    88    ),
    9     'reference' => '887bb439e965d138b19569d28fdd7ec6a345c567',
     9    'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d',
    1010    'name' => 'authress/wordpress-plugin.php',
    1111  ),
     
    1919      array (
    2020      ),
    21       'reference' => '887bb439e965d138b19569d28fdd7ec6a345c567',
     21      'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d',
    2222    ),
    2323    'codercat/jwk-to-pem' =>
  • authress/tags/0.2.64/wordpress/readme.txt

    r2690735 r2710778  
    55Requires PHP: 7.4
    66Tested up to: 5.9.1
    7 Stable tag: 0.2.53
     7Stable tag: 0.2.64
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
     
    77771. Enable your users to login with their email for any domain.
    7878
     79== How to customize this plugin ==
     80
     81This plugin provides extension points to make it easier to configure it exactly as you need. Check out the full docs:
     82* [SSO Login customizations](https://github.com/Authress/wordpress-sso-login/blob/main/docs/customizations.md)
     83
    7984== Changelog ==
    8085
  • authress/trunk/Authress_Sso_Login.php

    r2690735 r2710778  
    44    Plugin URI:   https://wordpress.org/plugins/authress
    55    Description:  Upgrades the WordPress login to support SSO Login.
    6     Version:      0.2.53
     6    Version:      0.2.64
    77    Author:       Authress
    88    Author URI:   https://authress.io
     
    1111*/
    1212
    13 define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.53' );
     13define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.64' );
    1414
    1515define( 'AUTHRESS_SSO_LOGIN_PLUGIN_FILE', __FILE__ );
     
    146146 */
    147147function authress_sso_login_render_lock_form( $html ) {
    148     authress_debug_log('authress_sso_login_render_lock_form');
     148    authress_debug_log('=> authress_sso_login_render_lock_form');
    149149
    150150    ob_start();
     
    155155    }
    156156
    157     authress_debug_log('Falling back to wp login form');
     157    authress_debug_log('=> Falling back to wp login form');
    158158    return $html;
    159159}
     
    257257
    258258function authress_sso_login_initial_setup_init() {
    259     authress_debug_log('authress_sso_login_initial_setup_init');
     259    authress_debug_log('=> authress_sso_login_initial_setup_init');
    260260    return false;
    261261}
     
    263263
    264264function authress_sso_login_init() {
    265     authress_debug_log('authress_sso_login_init()');
     265    authress_debug_log('=> authress_sso_login_init()');
    266266    $router = new Authress_Sso_Login_Routes( Authress_Sso_Login_Options::Instance() );
    267267    $router->setup_rewrites();
     
    270270
    271271function check_for_user_logged_in() {
    272     authress_debug_log('check_for_user_logged_in');
     272    authress_debug_log('=> check_for_user_logged_in');
    273273   
    274274    if (!is_user_logged_in() && isset($_REQUEST['nonce'])) {
     
    281281        // if (is_user_logged_in()) {
    282282        //  wp_safe_redirect(home_url());
    283         //  authress_debug_log('User successfully now logged in during handler');
     283        //  authress_debug_log('=> User successfully now logged in during handler');
    284284        // } else {
    285         //  authress_debug_log('User NOT logged in during handler');
     285        //  authress_debug_log('=> User NOT logged in during handler');
    286286        // }
    287287        // wp_safe_redirect();
     
    310310
    311311function authress_sso_login_init_admin_menu() {
    312     authress_debug_log('authress_sso_login_init_admin_menu');
     312    authress_debug_log('=> authress_sso_login_init_admin_menu');
    313313    if (is_admin() && !empty($_REQUEST['page']) && 'authress_help' === $_REQUEST['page']) {
    314314        wp_safe_redirect( admin_url( 'admin.php?page=authress_configuration#help' ), 301 );
     
    359359
    360360function authress_sso_login_init_admin() {
    361     authress_debug_log('authress_sso_login_init_admin');
     361    authress_debug_log('=> authress_sso_login_init_admin');
    362362    $options = Authress_Sso_Login_Options::Instance();
    363363    $routes  = new Authress_Sso_Login_Routes( $options );
     
    368368
    369369function authress_sso_login_admin_enqueue_scripts() {
    370     authress_debug_log('authress_sso_login_admin_enqueue_scripts');
     370    authress_debug_log('=> authress_sso_login_admin_enqueue_scripts');
    371371    $options = Authress_Sso_Login_Options::Instance();
    372372    $routes  = new Authress_Sso_Login_Routes( $options );
     
    383383
    384384function authress_sso_login_profile_enqueue_scripts() {
    385     authress_debug_log('authress_sso_login_profile_enqueue_scripts');
     385    authress_debug_log('=> authress_sso_login_profile_enqueue_scripts');
    386386    global $pagenow;
    387387
     
    425425    $users_repo    = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() );
    426426    $login_manager = new Authress_Sso_Login_LoginManager( $users_repo, Authress_Sso_Login_Options::Instance() );
    427     authress_debug_log('authress_wp_page_loaded');
     427    authress_debug_log('=> authress_wp_page_loaded');
    428428    return $login_manager->init_authress();
    429429}
     
    439439    $users_repo    = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() );
    440440    $login_manager = new Authress_Sso_Login_LoginManager( $users_repo, Authress_Sso_Login_Options::Instance() );
    441     authress_debug_log('authress_wp_login_widget_loaded');
     441    authress_debug_log('=> authress_wp_login_widget_loaded');
    442442    return $login_manager->login_auto();
    443443}
  • authress/trunk/lib/Authress_Sso_Login_LoginManager.php

    r2690711 r2710778  
    5454     */
    5555    public function login_auto() {
    56         authress_debug_log('login_auto');
     56        authress_debug_log('=> login_auto');
    5757        // Not processing form data, just using a redirect parameter if present.
    5858        // phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification
     
    9191     */
    9292    public function init_authress() {
    93         authress_debug_log('init_authress');
     93        authress_debug_log('=> init_authress');
    9494
    9595        // Not an Authress login process or settings are not configured to allow logins.
     
    112112        if ( is_user_logged_in() ) {
    113113            // wp_safe_redirect( $this->a0_options->get( 'default_login_redirection' ) );
    114             authress_debug_log('user_logged_in: returning without further setup');
     114            authress_debug_log('    returning without further setup');
    115115            return true;
    116116        }
     
    145145     */
    146146    public function handle_login_redirect() {
    147         authress_debug_log('handle_login_redirect');
     147        authress_debug_log('=> handle_login_redirect');
    148148        $access_token = sanitize_text_field(isset($_COOKIE['authorization']) ? wp_unslash($_COOKIE['authorization']) : '');
    149149        if (!isset($_COOKIE['authorization']) && isset($_REQUEST['access_token'])) {
     
    158158        }
    159159
    160         authress_debug_log('access_token: ' . $access_token);
    161         authress_debug_log('id_token:' . $id_token);
     160        authress_debug_log('    access_token: ' . $access_token);
     161        authress_debug_log('    id_token:' . $id_token);
    162162
    163163        if (empty($id_token) || empty($access_token)) {
    164             authress_debug_log('No tokens set, user is not logged in');
     164            authress_debug_log('    No tokens set, user is not logged in');
    165165            return false;
    166166        }
     
    171171
    172172        if ( $this->login_user($userinfo) ) {
    173             authress_debug_log('Tokens set, user is logged in');
     173            authress_debug_log('    Tokens set, user is logged in');
    174174            return true;
    175175        }
     
    192192
    193193        if ( ! is_null( $user ) ) {
    194             authress_debug_log('Existing user: updating');
     194            authress_debug_log('    Existing user: updating');
    195195            // User exists so log them in.
    196196            if ( isset( $userinfo->email ) && $user->data->user_email !== $userinfo->email ) {
     
    225225        }
    226226        try {
    227             authress_debug_log('New user: creating.');
     227            authress_debug_log('    New user: creating.');
    228228            $creator = new Authress_Sso_Login_UsersRepo( $this->a0_options );
    229229            $user_id = $creator->create( $userinfo);
     
    250250     */
    251251    private function do_login( $user) {
    252         authress_debug_log('LoginManager.do_login');
     252        authress_debug_log('=> LoginManager.do_login');
    253253        $remember_users_session = $this->a0_options->get( 'remember_users_session', true);
    254254
     
    318318     */
    319319    protected function die_on_login( $msg = '', $code = 0 ) {
    320         authress_debug_log('Ending User Session.');
     320        authress_debug_log('    Ending User Session: ' . $msg . ' ' . $code);
    321321
    322322        // Log the user out completely.
     
    349349     */
    350350    private function decode_id_token( $id_token ) {
     351        authress_debug_log('=> decode_id_token()');
    351352        $expectedIss = $this->a0_options->get_auth_domain();
    352353
     
    364365
    365366        $jwk = null;
    366         $signer = new Signer\Eddsa();
     367        $signer = null;
    367368        foreach ( $keys as $element ) {
    368             if ( $keyId === $element->kid ) {
    369                 $jwk = json_decode(wp_json_encode($element), true);
    370                 if ($element->alg === 'RS512') {
    371                     $signer = new Signer\Rsa\Sha512();
    372                 }
     369            if ( $keyId !== $element->kid ) {
     370                continue;
    373371            }
    374         }
    375 
    376         if ($jwk === null) {
     372
     373            if ($element->alg === 'RS512') {
     374                $signer = new Signer\Rsa\Sha512();
     375                $jwkConverter = new CoderCat\JWKToPEM\JWKConverter();
     376                $jwk = InMemory::plainText($jwkConverter->toPEM(json_decode(wp_json_encode($element), true)));
     377            } else {
     378                $signer = new Signer\Eddsa();
     379                $jwk = InMemory::plainText(base64_decode(strtr($element->x, '-_', '+/')), true);
     380            }
     381        }
     382
     383        if (empty($jwk) || $jwk === null) {
     384            authress_debug_log('   No $JWK found: ' . wp_json_encode($keys));
    377385            throw new Authress_Sso_Login_InvalidIdTokenException();
    378386        }
    379 
    380         $jwkConverter = new CoderCat\JWKToPEM\JWKConverter();       
    381387
    382388        $config->setValidationConstraints(new Constraint\LooseValidAt(SystemClock::fromUTC()));
    383389        $config->setValidationConstraints(new Constraint\IssuedBy($expectedIss));
    384         $config->setValidationConstraints(new Constraint\SignedWith($signer, InMemory::plainText($jwkConverter->toPEM($jwk))));
     390        $config->setValidationConstraints(new Constraint\SignedWith($signer, $jwk));
    385391        $constraints = $config->validationConstraints();
     392
    386393        try {
    387394            $config->validator()->assert($token, ...$constraints);
     
    389396            return $userObject;
    390397        } catch (RequiredConstraintsViolated $e) {
     398            authress_debug_log('   Invalid user authentication token. Error:' . $e->violations());
    391399            Authress_Sso_Login_ErrorLog::insert_error( __METHOD__, __( 'Invalid user authentication token:', 'wp-authress' ) . $e->violations());
     400            throw new Authress_Sso_Login_InvalidIdTokenException($e);
     401        } catch (Exception $e) {
     402            authress_debug_log('   Invalid user authentication token. Error:' . $e->getMessage());
     403            Authress_Sso_Login_ErrorLog::insert_error( __METHOD__, __( 'Failed to verify authentication token:', 'wp-authress' ) . $e->getMessage());
    392404            throw new Authress_Sso_Login_InvalidIdTokenException($e);
    393405        }
  • authress/trunk/readme.txt

    r2690735 r2710778  
    55Requires PHP: 7.4
    66Tested up to: 5.9.1
    7 Stable tag: 0.2.53
     7Stable tag: 0.2.64
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
     
    77771. Enable your users to login with their email for any domain.
    7878
     79== How to customize this plugin ==
     80
     81This plugin provides extension points to make it easier to configure it exactly as you need. Check out the full docs:
     82* [SSO Login customizations](https://github.com/Authress/wordpress-sso-login/blob/main/docs/customizations.md)
     83
    7984== Changelog ==
    8085
  • authress/trunk/vendor/autoload.php

    r2690735 r2710778  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit2b0eb5c91ca35dcfd0eb17b49510abdd::getLoader();
     7return ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd::getLoader();
  • authress/trunk/vendor/composer/InstalledVersions.php

    r2690735 r2710778  
    3131    array (
    3232    ),
    33     'reference' => '887bb439e965d138b19569d28fdd7ec6a345c567',
     33    'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d',
    3434    'name' => 'authress/wordpress-plugin.php',
    3535  ),
     
    4343      array (
    4444      ),
    45       'reference' => '887bb439e965d138b19569d28fdd7ec6a345c567',
     45      'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d',
    4646    ),
    4747    'codercat/jwk-to-pem' =>
  • authress/trunk/vendor/composer/autoload_real.php

    r2690735 r2710778  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit2b0eb5c91ca35dcfd0eb17b49510abdd
     5class ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit2b0eb5c91ca35dcfd0eb17b49510abdd', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit2b0eb5c91ca35dcfd0eb17b49510abdd', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInitcd79ff3a427c493345a770421550b0dd::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
     
    5454
    5555        if ($useStaticLoader) {
    56             $includeFiles = Composer\Autoload\ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$files;
     56            $includeFiles = Composer\Autoload\ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$files;
    5757        } else {
    5858            $includeFiles = require __DIR__ . '/autoload_files.php';
    5959        }
    6060        foreach ($includeFiles as $fileIdentifier => $file) {
    61             composerRequire2b0eb5c91ca35dcfd0eb17b49510abdd($fileIdentifier, $file);
     61            composerRequirecd79ff3a427c493345a770421550b0dd($fileIdentifier, $file);
    6262        }
    6363
     
    6666}
    6767
    68 function composerRequire2b0eb5c91ca35dcfd0eb17b49510abdd($fileIdentifier, $file)
     68function composerRequirecd79ff3a427c493345a770421550b0dd($fileIdentifier, $file)
    6969{
    7070    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • authress/trunk/vendor/composer/autoload_static.php

    r2690735 r2710778  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd
     7class ComposerStaticInitcd79ff3a427c493345a770421550b0dd
    88{
    99    public static $files = array (
     
    631631    {
    632632        return \Closure::bind(function () use ($loader) {
    633             $loader->prefixLengthsPsr4 = ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$prefixLengthsPsr4;
    634             $loader->prefixDirsPsr4 = ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$prefixDirsPsr4;
    635             $loader->fallbackDirsPsr4 = ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$fallbackDirsPsr4;
    636             $loader->classMap = ComposerStaticInit2b0eb5c91ca35dcfd0eb17b49510abdd::$classMap;
     633            $loader->prefixLengthsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$prefixLengthsPsr4;
     634            $loader->prefixDirsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$prefixDirsPsr4;
     635            $loader->fallbackDirsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$fallbackDirsPsr4;
     636            $loader->classMap = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$classMap;
    637637
    638638        }, null, ClassLoader::class);
  • authress/trunk/vendor/composer/installed.php

    r2690735 r2710778  
    77    array (
    88    ),
    9     'reference' => '887bb439e965d138b19569d28fdd7ec6a345c567',
     9    'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d',
    1010    'name' => 'authress/wordpress-plugin.php',
    1111  ),
     
    1919      array (
    2020      ),
    21       'reference' => '887bb439e965d138b19569d28fdd7ec6a345c567',
     21      'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d',
    2222    ),
    2323    'codercat/jwk-to-pem' =>
  • authress/trunk/wordpress/readme.txt

    r2690735 r2710778  
    55Requires PHP: 7.4
    66Tested up to: 5.9.1
    7 Stable tag: 0.2.53
     7Stable tag: 0.2.64
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
     
    77771. Enable your users to login with their email for any domain.
    7878
     79== How to customize this plugin ==
     80
     81This plugin provides extension points to make it easier to configure it exactly as you need. Check out the full docs:
     82* [SSO Login customizations](https://github.com/Authress/wordpress-sso-login/blob/main/docs/customizations.md)
     83
    7984== Changelog ==
    8085
Note: See TracChangeset for help on using the changeset viewer.