Changeset 2710778
- Timestamp:
- 04/17/2022 03:41:34 PM (4 years ago)
- Location:
- authress
- Files:
-
- 2 deleted
- 19 edited
- 1 copied
-
assets/readme.txt (modified) (2 diffs)
-
tags/0.2.64 (copied) (copied from authress/trunk)
-
tags/0.2.64/Authress_Sso_Login.php (modified) (14 diffs)
-
tags/0.2.64/docs (deleted)
-
tags/0.2.64/lib/Authress_Sso_Login_LoginManager.php (modified) (13 diffs)
-
tags/0.2.64/readme.txt (modified) (2 diffs)
-
tags/0.2.64/vendor/autoload.php (modified) (1 diff)
-
tags/0.2.64/vendor/composer/InstalledVersions.php (modified) (2 diffs)
-
tags/0.2.64/vendor/composer/autoload_real.php (modified) (5 diffs)
-
tags/0.2.64/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/0.2.64/vendor/composer/installed.php (modified) (2 diffs)
-
tags/0.2.64/wordpress/readme.txt (modified) (2 diffs)
-
trunk/Authress_Sso_Login.php (modified) (14 diffs)
-
trunk/docs (deleted)
-
trunk/lib/Authress_Sso_Login_LoginManager.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/InstalledVersions.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_real.php (modified) (5 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/wordpress/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
authress/assets/readme.txt
r2690735 r2710778 5 5 Requires PHP: 7.4 6 6 Tested up to: 5.9.1 7 Stable tag: 0.2. 537 Stable tag: 0.2.64 8 8 License: Apache-2.0 9 9 License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE … … 77 77 1. Enable your users to login with their email for any domain. 78 78 79 == How to customize this plugin == 80 81 This 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 79 84 == Changelog == 80 85 -
authress/tags/0.2.64/Authress_Sso_Login.php
r2690735 r2710778 4 4 Plugin URI: https://wordpress.org/plugins/authress 5 5 Description: Upgrades the WordPress login to support SSO Login. 6 Version: 0.2. 536 Version: 0.2.64 7 7 Author: Authress 8 8 Author URI: https://authress.io … … 11 11 */ 12 12 13 define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2. 53' );13 define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.64' ); 14 14 15 15 define( 'AUTHRESS_SSO_LOGIN_PLUGIN_FILE', __FILE__ ); … … 146 146 */ 147 147 function 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'); 149 149 150 150 ob_start(); … … 155 155 } 156 156 157 authress_debug_log(' Falling back to wp login form');157 authress_debug_log('=> Falling back to wp login form'); 158 158 return $html; 159 159 } … … 257 257 258 258 function 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'); 260 260 return false; 261 261 } … … 263 263 264 264 function authress_sso_login_init() { 265 authress_debug_log(' authress_sso_login_init()');265 authress_debug_log('=> authress_sso_login_init()'); 266 266 $router = new Authress_Sso_Login_Routes( Authress_Sso_Login_Options::Instance() ); 267 267 $router->setup_rewrites(); … … 270 270 271 271 function check_for_user_logged_in() { 272 authress_debug_log(' check_for_user_logged_in');272 authress_debug_log('=> check_for_user_logged_in'); 273 273 274 274 if (!is_user_logged_in() && isset($_REQUEST['nonce'])) { … … 281 281 // if (is_user_logged_in()) { 282 282 // 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'); 284 284 // } else { 285 // authress_debug_log(' User NOT logged in during handler');285 // authress_debug_log('=> User NOT logged in during handler'); 286 286 // } 287 287 // wp_safe_redirect(); … … 310 310 311 311 function 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'); 313 313 if (is_admin() && !empty($_REQUEST['page']) && 'authress_help' === $_REQUEST['page']) { 314 314 wp_safe_redirect( admin_url( 'admin.php?page=authress_configuration#help' ), 301 ); … … 359 359 360 360 function authress_sso_login_init_admin() { 361 authress_debug_log(' authress_sso_login_init_admin');361 authress_debug_log('=> authress_sso_login_init_admin'); 362 362 $options = Authress_Sso_Login_Options::Instance(); 363 363 $routes = new Authress_Sso_Login_Routes( $options ); … … 368 368 369 369 function 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'); 371 371 $options = Authress_Sso_Login_Options::Instance(); 372 372 $routes = new Authress_Sso_Login_Routes( $options ); … … 383 383 384 384 function 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'); 386 386 global $pagenow; 387 387 … … 425 425 $users_repo = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() ); 426 426 $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'); 428 428 return $login_manager->init_authress(); 429 429 } … … 439 439 $users_repo = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() ); 440 440 $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'); 442 442 return $login_manager->login_auto(); 443 443 } -
authress/tags/0.2.64/lib/Authress_Sso_Login_LoginManager.php
r2690711 r2710778 54 54 */ 55 55 public function login_auto() { 56 authress_debug_log(' login_auto');56 authress_debug_log('=> login_auto'); 57 57 // Not processing form data, just using a redirect parameter if present. 58 58 // phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification … … 91 91 */ 92 92 public function init_authress() { 93 authress_debug_log(' init_authress');93 authress_debug_log('=> init_authress'); 94 94 95 95 // Not an Authress login process or settings are not configured to allow logins. … … 112 112 if ( is_user_logged_in() ) { 113 113 // 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'); 115 115 return true; 116 116 } … … 145 145 */ 146 146 public function handle_login_redirect() { 147 authress_debug_log(' handle_login_redirect');147 authress_debug_log('=> handle_login_redirect'); 148 148 $access_token = sanitize_text_field(isset($_COOKIE['authorization']) ? wp_unslash($_COOKIE['authorization']) : ''); 149 149 if (!isset($_COOKIE['authorization']) && isset($_REQUEST['access_token'])) { … … 158 158 } 159 159 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); 162 162 163 163 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'); 165 165 return false; 166 166 } … … 171 171 172 172 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'); 174 174 return true; 175 175 } … … 192 192 193 193 if ( ! is_null( $user ) ) { 194 authress_debug_log(' Existing user: updating');194 authress_debug_log(' Existing user: updating'); 195 195 // User exists so log them in. 196 196 if ( isset( $userinfo->email ) && $user->data->user_email !== $userinfo->email ) { … … 225 225 } 226 226 try { 227 authress_debug_log(' New user: creating.');227 authress_debug_log(' New user: creating.'); 228 228 $creator = new Authress_Sso_Login_UsersRepo( $this->a0_options ); 229 229 $user_id = $creator->create( $userinfo); … … 250 250 */ 251 251 private function do_login( $user) { 252 authress_debug_log(' LoginManager.do_login');252 authress_debug_log('=> LoginManager.do_login'); 253 253 $remember_users_session = $this->a0_options->get( 'remember_users_session', true); 254 254 … … 318 318 */ 319 319 protected function die_on_login( $msg = '', $code = 0 ) { 320 authress_debug_log(' Ending User Session.');320 authress_debug_log(' Ending User Session: ' . $msg . ' ' . $code); 321 321 322 322 // Log the user out completely. … … 349 349 */ 350 350 private function decode_id_token( $id_token ) { 351 authress_debug_log('=> decode_id_token()'); 351 352 $expectedIss = $this->a0_options->get_auth_domain(); 352 353 … … 364 365 365 366 $jwk = null; 366 $signer = n ew Signer\Eddsa();367 $signer = null; 367 368 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; 373 371 } 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)); 377 385 throw new Authress_Sso_Login_InvalidIdTokenException(); 378 386 } 379 380 $jwkConverter = new CoderCat\JWKToPEM\JWKConverter();381 387 382 388 $config->setValidationConstraints(new Constraint\LooseValidAt(SystemClock::fromUTC())); 383 389 $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)); 385 391 $constraints = $config->validationConstraints(); 392 386 393 try { 387 394 $config->validator()->assert($token, ...$constraints); … … 389 396 return $userObject; 390 397 } catch (RequiredConstraintsViolated $e) { 398 authress_debug_log(' Invalid user authentication token. Error:' . $e->violations()); 391 399 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()); 392 404 throw new Authress_Sso_Login_InvalidIdTokenException($e); 393 405 } -
authress/tags/0.2.64/readme.txt
r2690735 r2710778 5 5 Requires PHP: 7.4 6 6 Tested up to: 5.9.1 7 Stable tag: 0.2. 537 Stable tag: 0.2.64 8 8 License: Apache-2.0 9 9 License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE … … 77 77 1. Enable your users to login with their email for any domain. 78 78 79 == How to customize this plugin == 80 81 This 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 79 84 == Changelog == 80 85 -
authress/tags/0.2.64/vendor/autoload.php
r2690735 r2710778 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 2b0eb5c91ca35dcfd0eb17b49510abdd::getLoader();7 return ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd::getLoader(); -
authress/tags/0.2.64/vendor/composer/InstalledVersions.php
r2690735 r2710778 31 31 array ( 32 32 ), 33 'reference' => '8 87bb439e965d138b19569d28fdd7ec6a345c567',33 'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d', 34 34 'name' => 'authress/wordpress-plugin.php', 35 35 ), … … 43 43 array ( 44 44 ), 45 'reference' => '8 87bb439e965d138b19569d28fdd7ec6a345c567',45 'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d', 46 46 ), 47 47 'codercat/jwk-to-pem' => -
authress/tags/0.2.64/vendor/composer/autoload_real.php
r2690735 r2710778 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 2b0eb5c91ca35dcfd0eb17b49510abdd5 class ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 2b0eb5c91ca35dcfd0eb17b49510abdd', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 2b0eb5c91ca35dcfd0eb17b49510abdd', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd', 'loadClassLoader')); 30 30 31 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 33 33 require __DIR__ . '/autoload_static.php'; 34 34 35 call_user_func(\Composer\Autoload\ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInitcd79ff3a427c493345a770421550b0dd::getInitializer($loader)); 36 36 } else { 37 37 $map = require __DIR__ . '/autoload_namespaces.php'; … … 54 54 55 55 if ($useStaticLoader) { 56 $includeFiles = Composer\Autoload\ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$files;56 $includeFiles = Composer\Autoload\ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$files; 57 57 } else { 58 58 $includeFiles = require __DIR__ . '/autoload_files.php'; 59 59 } 60 60 foreach ($includeFiles as $fileIdentifier => $file) { 61 composerRequire 2b0eb5c91ca35dcfd0eb17b49510abdd($fileIdentifier, $file);61 composerRequirecd79ff3a427c493345a770421550b0dd($fileIdentifier, $file); 62 62 } 63 63 … … 66 66 } 67 67 68 function composerRequire 2b0eb5c91ca35dcfd0eb17b49510abdd($fileIdentifier, $file)68 function composerRequirecd79ff3a427c493345a770421550b0dd($fileIdentifier, $file) 69 69 { 70 70 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { -
authress/tags/0.2.64/vendor/composer/autoload_static.php
r2690735 r2710778 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd7 class ComposerStaticInitcd79ff3a427c493345a770421550b0dd 8 8 { 9 9 public static $files = array ( … … 631 631 { 632 632 return \Closure::bind(function () use ($loader) { 633 $loader->prefixLengthsPsr4 = ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$prefixLengthsPsr4;634 $loader->prefixDirsPsr4 = ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$prefixDirsPsr4;635 $loader->fallbackDirsPsr4 = ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$fallbackDirsPsr4;636 $loader->classMap = ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$classMap;633 $loader->prefixLengthsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$prefixLengthsPsr4; 634 $loader->prefixDirsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$prefixDirsPsr4; 635 $loader->fallbackDirsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$fallbackDirsPsr4; 636 $loader->classMap = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$classMap; 637 637 638 638 }, null, ClassLoader::class); -
authress/tags/0.2.64/vendor/composer/installed.php
r2690735 r2710778 7 7 array ( 8 8 ), 9 'reference' => '8 87bb439e965d138b19569d28fdd7ec6a345c567',9 'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d', 10 10 'name' => 'authress/wordpress-plugin.php', 11 11 ), … … 19 19 array ( 20 20 ), 21 'reference' => '8 87bb439e965d138b19569d28fdd7ec6a345c567',21 'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d', 22 22 ), 23 23 'codercat/jwk-to-pem' => -
authress/tags/0.2.64/wordpress/readme.txt
r2690735 r2710778 5 5 Requires PHP: 7.4 6 6 Tested up to: 5.9.1 7 Stable tag: 0.2. 537 Stable tag: 0.2.64 8 8 License: Apache-2.0 9 9 License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE … … 77 77 1. Enable your users to login with their email for any domain. 78 78 79 == How to customize this plugin == 80 81 This 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 79 84 == Changelog == 80 85 -
authress/trunk/Authress_Sso_Login.php
r2690735 r2710778 4 4 Plugin URI: https://wordpress.org/plugins/authress 5 5 Description: Upgrades the WordPress login to support SSO Login. 6 Version: 0.2. 536 Version: 0.2.64 7 7 Author: Authress 8 8 Author URI: https://authress.io … … 11 11 */ 12 12 13 define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2. 53' );13 define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.64' ); 14 14 15 15 define( 'AUTHRESS_SSO_LOGIN_PLUGIN_FILE', __FILE__ ); … … 146 146 */ 147 147 function 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'); 149 149 150 150 ob_start(); … … 155 155 } 156 156 157 authress_debug_log(' Falling back to wp login form');157 authress_debug_log('=> Falling back to wp login form'); 158 158 return $html; 159 159 } … … 257 257 258 258 function 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'); 260 260 return false; 261 261 } … … 263 263 264 264 function authress_sso_login_init() { 265 authress_debug_log(' authress_sso_login_init()');265 authress_debug_log('=> authress_sso_login_init()'); 266 266 $router = new Authress_Sso_Login_Routes( Authress_Sso_Login_Options::Instance() ); 267 267 $router->setup_rewrites(); … … 270 270 271 271 function check_for_user_logged_in() { 272 authress_debug_log(' check_for_user_logged_in');272 authress_debug_log('=> check_for_user_logged_in'); 273 273 274 274 if (!is_user_logged_in() && isset($_REQUEST['nonce'])) { … … 281 281 // if (is_user_logged_in()) { 282 282 // 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'); 284 284 // } else { 285 // authress_debug_log(' User NOT logged in during handler');285 // authress_debug_log('=> User NOT logged in during handler'); 286 286 // } 287 287 // wp_safe_redirect(); … … 310 310 311 311 function 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'); 313 313 if (is_admin() && !empty($_REQUEST['page']) && 'authress_help' === $_REQUEST['page']) { 314 314 wp_safe_redirect( admin_url( 'admin.php?page=authress_configuration#help' ), 301 ); … … 359 359 360 360 function authress_sso_login_init_admin() { 361 authress_debug_log(' authress_sso_login_init_admin');361 authress_debug_log('=> authress_sso_login_init_admin'); 362 362 $options = Authress_Sso_Login_Options::Instance(); 363 363 $routes = new Authress_Sso_Login_Routes( $options ); … … 368 368 369 369 function 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'); 371 371 $options = Authress_Sso_Login_Options::Instance(); 372 372 $routes = new Authress_Sso_Login_Routes( $options ); … … 383 383 384 384 function 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'); 386 386 global $pagenow; 387 387 … … 425 425 $users_repo = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() ); 426 426 $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'); 428 428 return $login_manager->init_authress(); 429 429 } … … 439 439 $users_repo = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() ); 440 440 $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'); 442 442 return $login_manager->login_auto(); 443 443 } -
authress/trunk/lib/Authress_Sso_Login_LoginManager.php
r2690711 r2710778 54 54 */ 55 55 public function login_auto() { 56 authress_debug_log(' login_auto');56 authress_debug_log('=> login_auto'); 57 57 // Not processing form data, just using a redirect parameter if present. 58 58 // phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification … … 91 91 */ 92 92 public function init_authress() { 93 authress_debug_log(' init_authress');93 authress_debug_log('=> init_authress'); 94 94 95 95 // Not an Authress login process or settings are not configured to allow logins. … … 112 112 if ( is_user_logged_in() ) { 113 113 // 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'); 115 115 return true; 116 116 } … … 145 145 */ 146 146 public function handle_login_redirect() { 147 authress_debug_log(' handle_login_redirect');147 authress_debug_log('=> handle_login_redirect'); 148 148 $access_token = sanitize_text_field(isset($_COOKIE['authorization']) ? wp_unslash($_COOKIE['authorization']) : ''); 149 149 if (!isset($_COOKIE['authorization']) && isset($_REQUEST['access_token'])) { … … 158 158 } 159 159 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); 162 162 163 163 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'); 165 165 return false; 166 166 } … … 171 171 172 172 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'); 174 174 return true; 175 175 } … … 192 192 193 193 if ( ! is_null( $user ) ) { 194 authress_debug_log(' Existing user: updating');194 authress_debug_log(' Existing user: updating'); 195 195 // User exists so log them in. 196 196 if ( isset( $userinfo->email ) && $user->data->user_email !== $userinfo->email ) { … … 225 225 } 226 226 try { 227 authress_debug_log(' New user: creating.');227 authress_debug_log(' New user: creating.'); 228 228 $creator = new Authress_Sso_Login_UsersRepo( $this->a0_options ); 229 229 $user_id = $creator->create( $userinfo); … … 250 250 */ 251 251 private function do_login( $user) { 252 authress_debug_log(' LoginManager.do_login');252 authress_debug_log('=> LoginManager.do_login'); 253 253 $remember_users_session = $this->a0_options->get( 'remember_users_session', true); 254 254 … … 318 318 */ 319 319 protected function die_on_login( $msg = '', $code = 0 ) { 320 authress_debug_log(' Ending User Session.');320 authress_debug_log(' Ending User Session: ' . $msg . ' ' . $code); 321 321 322 322 // Log the user out completely. … … 349 349 */ 350 350 private function decode_id_token( $id_token ) { 351 authress_debug_log('=> decode_id_token()'); 351 352 $expectedIss = $this->a0_options->get_auth_domain(); 352 353 … … 364 365 365 366 $jwk = null; 366 $signer = n ew Signer\Eddsa();367 $signer = null; 367 368 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; 373 371 } 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)); 377 385 throw new Authress_Sso_Login_InvalidIdTokenException(); 378 386 } 379 380 $jwkConverter = new CoderCat\JWKToPEM\JWKConverter();381 387 382 388 $config->setValidationConstraints(new Constraint\LooseValidAt(SystemClock::fromUTC())); 383 389 $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)); 385 391 $constraints = $config->validationConstraints(); 392 386 393 try { 387 394 $config->validator()->assert($token, ...$constraints); … … 389 396 return $userObject; 390 397 } catch (RequiredConstraintsViolated $e) { 398 authress_debug_log(' Invalid user authentication token. Error:' . $e->violations()); 391 399 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()); 392 404 throw new Authress_Sso_Login_InvalidIdTokenException($e); 393 405 } -
authress/trunk/readme.txt
r2690735 r2710778 5 5 Requires PHP: 7.4 6 6 Tested up to: 5.9.1 7 Stable tag: 0.2. 537 Stable tag: 0.2.64 8 8 License: Apache-2.0 9 9 License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE … … 77 77 1. Enable your users to login with their email for any domain. 78 78 79 == How to customize this plugin == 80 81 This 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 79 84 == Changelog == 80 85 -
authress/trunk/vendor/autoload.php
r2690735 r2710778 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 2b0eb5c91ca35dcfd0eb17b49510abdd::getLoader();7 return ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd::getLoader(); -
authress/trunk/vendor/composer/InstalledVersions.php
r2690735 r2710778 31 31 array ( 32 32 ), 33 'reference' => '8 87bb439e965d138b19569d28fdd7ec6a345c567',33 'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d', 34 34 'name' => 'authress/wordpress-plugin.php', 35 35 ), … … 43 43 array ( 44 44 ), 45 'reference' => '8 87bb439e965d138b19569d28fdd7ec6a345c567',45 'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d', 46 46 ), 47 47 'codercat/jwk-to-pem' => -
authress/trunk/vendor/composer/autoload_real.php
r2690735 r2710778 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 2b0eb5c91ca35dcfd0eb17b49510abdd5 class ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 2b0eb5c91ca35dcfd0eb17b49510abdd', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 2b0eb5c91ca35dcfd0eb17b49510abdd', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitcd79ff3a427c493345a770421550b0dd', 'loadClassLoader')); 30 30 31 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 33 33 require __DIR__ . '/autoload_static.php'; 34 34 35 call_user_func(\Composer\Autoload\ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInitcd79ff3a427c493345a770421550b0dd::getInitializer($loader)); 36 36 } else { 37 37 $map = require __DIR__ . '/autoload_namespaces.php'; … … 54 54 55 55 if ($useStaticLoader) { 56 $includeFiles = Composer\Autoload\ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$files;56 $includeFiles = Composer\Autoload\ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$files; 57 57 } else { 58 58 $includeFiles = require __DIR__ . '/autoload_files.php'; 59 59 } 60 60 foreach ($includeFiles as $fileIdentifier => $file) { 61 composerRequire 2b0eb5c91ca35dcfd0eb17b49510abdd($fileIdentifier, $file);61 composerRequirecd79ff3a427c493345a770421550b0dd($fileIdentifier, $file); 62 62 } 63 63 … … 66 66 } 67 67 68 function composerRequire 2b0eb5c91ca35dcfd0eb17b49510abdd($fileIdentifier, $file)68 function composerRequirecd79ff3a427c493345a770421550b0dd($fileIdentifier, $file) 69 69 { 70 70 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { -
authress/trunk/vendor/composer/autoload_static.php
r2690735 r2710778 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd7 class ComposerStaticInitcd79ff3a427c493345a770421550b0dd 8 8 { 9 9 public static $files = array ( … … 631 631 { 632 632 return \Closure::bind(function () use ($loader) { 633 $loader->prefixLengthsPsr4 = ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$prefixLengthsPsr4;634 $loader->prefixDirsPsr4 = ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$prefixDirsPsr4;635 $loader->fallbackDirsPsr4 = ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$fallbackDirsPsr4;636 $loader->classMap = ComposerStaticInit 2b0eb5c91ca35dcfd0eb17b49510abdd::$classMap;633 $loader->prefixLengthsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$prefixLengthsPsr4; 634 $loader->prefixDirsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$prefixDirsPsr4; 635 $loader->fallbackDirsPsr4 = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$fallbackDirsPsr4; 636 $loader->classMap = ComposerStaticInitcd79ff3a427c493345a770421550b0dd::$classMap; 637 637 638 638 }, null, ClassLoader::class); -
authress/trunk/vendor/composer/installed.php
r2690735 r2710778 7 7 array ( 8 8 ), 9 'reference' => '8 87bb439e965d138b19569d28fdd7ec6a345c567',9 'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d', 10 10 'name' => 'authress/wordpress-plugin.php', 11 11 ), … … 19 19 array ( 20 20 ), 21 'reference' => '8 87bb439e965d138b19569d28fdd7ec6a345c567',21 'reference' => '8523a3c12a09017ad75cc6d9047d9c22a167330d', 22 22 ), 23 23 'codercat/jwk-to-pem' => -
authress/trunk/wordpress/readme.txt
r2690735 r2710778 5 5 Requires PHP: 7.4 6 6 Tested up to: 5.9.1 7 Stable tag: 0.2. 537 Stable tag: 0.2.64 8 8 License: Apache-2.0 9 9 License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE … … 77 77 1. Enable your users to login with their email for any domain. 78 78 79 == How to customize this plugin == 80 81 This 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 79 84 == Changelog == 80 85
Note: See TracChangeset
for help on using the changeset viewer.