Changeset 2698055
- Timestamp:
- 03/23/2022 01:48:21 AM (4 years ago)
- Location:
- daggerhart-openid-connect-generic
- Files:
-
- 6 added
- 16 edited
- 1 copied
-
tags/3.9.0 (copied) (copied from daggerhart-openid-connect-generic/trunk)
-
tags/3.9.0/CHANGELOG.md (modified) (1 diff)
-
tags/3.9.0/docker-compose.wp-env.yml (added)
-
tags/3.9.0/docker-compose.yml (added)
-
tags/3.9.0/includes/functions.php (added)
-
tags/3.9.0/includes/openid-connect-generic-client-wrapper.php (modified) (27 diffs)
-
tags/3.9.0/includes/openid-connect-generic-client.php (modified) (5 diffs)
-
tags/3.9.0/includes/openid-connect-generic-option-settings.php (modified) (2 diffs)
-
tags/3.9.0/includes/openid-connect-generic-settings-page.php (modified) (10 diffs)
-
tags/3.9.0/languages/openid-connect-generic.pot (modified) (16 diffs)
-
tags/3.9.0/openid-connect-generic.php (modified) (10 diffs)
-
tags/3.9.0/readme.txt (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/docker-compose.wp-env.yml (added)
-
trunk/docker-compose.yml (added)
-
trunk/includes/functions.php (added)
-
trunk/includes/openid-connect-generic-client-wrapper.php (modified) (27 diffs)
-
trunk/includes/openid-connect-generic-client.php (modified) (5 diffs)
-
trunk/includes/openid-connect-generic-option-settings.php (modified) (2 diffs)
-
trunk/includes/openid-connect-generic-settings-page.php (modified) (10 diffs)
-
trunk/languages/openid-connect-generic.pot (modified) (16 diffs)
-
trunk/openid-connect-generic.php (modified) (10 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
daggerhart-openid-connect-generic/tags/3.9.0/CHANGELOG.md
r2516022 r2698055 1 1 # OpenId Connect Generic Changelog 2 2 3 3.8.5 4 * Fix: @timnolte - Fixes missing URL request validation before use & ensure proper current page URL is setup for Redirect Back. 5 * Fix: @timnolte - Fixes Redirect URL Logic to Handle Sub-directory Installs. 6 * Fix: @timnolte - Fixes to provide proper redirect user back for the openid_connect_generic_auth_url shortcode. 3 3.9.0 7 4 8 3.8.4 9 * Fix: @timnolte - Fixed invalid State object access for redirection handling. 10 * Improvement: @timnolte - Fixed local wp-env Docker development environment. 11 * Improvement: @timnolte - Fixed Composer scripts for linting and static analysis. 5 - Feature: @matchaxnb - Added support for additional configuration constants. 6 - Feature: @schanzen - Added support for agregated claims. 7 - Fix: @rkcreation - Fixed access token not updating user metadata after login. 8 - Fix: @danc1248 - Fixed user creation issue on Multisite Networks. 9 - Feature: @RobjS - Added plugin singleton to support for more developer customization. 10 - Feature: @jkouris - Added action hook to allow custom handling of session expiration. 11 - Fix: @tommcc - Fixed admin CSS loading only on the plugin settings screen. 12 - Feature: @rkcreation - Added method to refresh the user claim. 13 - Feature: @Glowsome - Added acr_values support & verification checks that it when defined in options is honored. 14 - Fix: @timnolte - Fixed regression which caused improper fallback on missing claims. 15 - Fix: @slykar - Fixed missing query string handling in redirect URL. 16 - Fix: @timnolte - Fixed issue with some user linking and user creation handling. 17 - Improvement: @timnolte - Fixed plugin settings typos and screen formatting. 18 - Security: @timnolte - Updated build tooling security vulnerabilities. 19 - Improvement: @timnolte - Changed build tooling scripts. 12 20 13 3.8.3 21 3.8.5 14 22 15 * Fix: @timnolte - Fixed problems with proper redirect handling.16 * Improvement: @timnolte - Changes redirect handling to use State instead of cookies.17 * Improvement: @timnolte - Refactored additional code to meet coding standards.23 - Fix: @timnolte - Fixed missing URL request validation before use & ensure proper current page URL is setup for Redirect Back. 24 - Fix: @timnolte - Fixed Redirect URL Logic to Handle Sub-directory Installs. 25 - Fix: @timnolte - Fixed issue with redirecting user back when the openid_connect_generic_auth_url shortcode is used. 18 26 19 3.8.2 27 3.8.4 20 28 21 * Fix: @timnolte - Fixed reported XSS vulnerability on WordPress login screen. 29 - Fix: @timnolte - Fixed invalid State object access for redirection handling. 30 - Improvement: @timnolte - Fixed local wp-env Docker development environment. 31 - Improvement: @timnolte - Fixed Composer scripts for linting and static analysis. 22 32 23 3.8.1 33 3.8.3 24 34 25 * Fix: @timnolte - Prevent SSO redirect on password protected posts.26 * Fix: @timnolte - CI/CD build issues.27 * Fix: @timnolte - Invalid redirect handling on logout for Auto Login setting.35 - Fix: @timnolte - Fixed problems with proper redirect handling. 36 - Improvement: @timnolte - Changes redirect handling to use State instead of cookies. 37 - Improvement: @timnolte - Refactored additional code to meet coding standards. 28 38 29 3.8.0 39 3.8.2 30 40 31 * Feature: @timnolte - Ability to use 6 new constants for setting client configuration instead of storing in the DB. 32 * Improvement: @timnolte - NPM version requirements for development. 33 * Improvement: @timnolte - Travis CI build fixes. 34 * Improvement: @timnolte - GrumPHP configuration updates for code contributions. 35 * Improvement: @timnolte - Refactored to meet WordPress coding standards. 36 * Improvement: @timnolte - Refactored to provide localization. 37 * Improvement: @timnolte - Refactored to provide a Docker-based local development environment. 41 - Fix: @timnolte - Fixed reported XSS vulnerability on WordPress login screen. 38 42 39 3.7.143 3.8.1 40 44 41 * Fix: Release Version Number. 45 - Fix: @timnolte - Prevent SSO redirect on password protected posts. 46 - Fix: @timnolte - CI/CD build issues. 47 - Fix: @timnolte - Invalid redirect handling on logout for Auto Login setting. 42 48 43 3.7.049 3.8.0 44 50 45 * Feature: @timnolte - Ability to enable/disable token refresh. Useful for IDPs that don't support token refresh. 46 * Feature: @timnolte - Support custom redirect URL(`redirect_to`) with the authentication URL & login button shortcodes. 51 - Feature: @timnolte - Ability to use 6 new constants for setting client configuration instead of storing in the DB. 52 - Improvement: @timnolte - NPM version requirements for development. 53 - Improvement: @timnolte - Travis CI build fixes. 54 - Improvement: @timnolte - GrumPHP configuration updates for code contributions. 55 - Improvement: @timnolte - Refactored to meet WordPress coding standards. 56 - Improvement: @timnolte - Refactored to provide localization. 57 - Improvement: @timnolte - Refactored to provide a Docker-based local development environment. 58 59 3.7.1 60 61 - Fix: Release Version Number. 62 63 3.7.0 64 65 - Feature: @timnolte - Ability to enable/disable token refresh. Useful for IDPs that don't support token refresh. 66 - Feature: @timnolte - Support custom redirect URL(`redirect_to`) with the authentication URL & login button shortcodes. 67 47 68 - Supports additional attribute overrides including login `button_text`, `endpoint_login`, `scope`, `redirect_uri`. 48 69 49 3.6.070 3.6.0 50 71 51 *Improvement: @RobjS - Improved error messages during login state failure.52 *Improvement: @RobjS - New developer filter for login form button URL.53 *Fix: @cs1m0n - Only increment username during new user creation if the "Link existing user" setting is enabled.54 *Fix: @xRy-42 - Allow periods and spaces in usernames to match what WordPress core allows.55 *Feature: @benochen - New setting named "Create user if does not exist" determines whether new users are created during login attempts.56 *Improvement: @flat235 - Username transliteration and normalization.72 - Improvement: @RobjS - Improved error messages during login state failure. 73 - Improvement: @RobjS - New developer filter for login form button URL. 74 - Fix: @cs1m0n - Only increment username during new user creation if the "Link existing user" setting is enabled. 75 - Fix: @xRy-42 - Allow periods and spaces in usernames to match what WordPress core allows. 76 - Feature: @benochen - New setting named "Create user if does not exist" determines whether new users are created during login attempts. 77 - Improvement: @flat235 - Username transliteration and normalization. 57 78 58 3.5.179 3.5.1 59 80 60 *Fix: @daggerhart - New approach to state management using transients.81 - Fix: @daggerhart - New approach to state management using transients. 61 82 62 3.5.083 3.5.0 63 84 64 *Readme fix: @thijskh - Fix syntax error in example openid-connect-generic-login-button-text65 *Feature: @slavicd - Allow override of the plugin by posting credentials to wp-login.php66 *Feature: @gassan - New action on use login67 *Fix: @daggerhart - Avoid double question marks in auth url query string68 *Fix: @drzraf - wp-cli bootstrap must not inhibit custom rewrite rules69 *Syntax change: @mullikine - Change PHP keywords to comply with PSR285 - Readme fix: @thijskh - Fix syntax error in example openid-connect-generic-login-button-text 86 - Feature: @slavicd - Allow override of the plugin by posting credentials to wp-login.php 87 - Feature: @gassan - New action on use login 88 - Fix: @daggerhart - Avoid double question marks in auth url query string 89 - Fix: @drzraf - wp-cli bootstrap must not inhibit custom rewrite rules 90 - Syntax change: @mullikine - Change PHP keywords to comply with PSR2 70 91 71 92 **3.4.1** 72 93 73 *Minor documentation update and additional error checking.94 - Minor documentation update and additional error checking. 74 95 75 96 **3.4.0** 76 97 77 *Feature: @drzraf - New filter hook: ability to filter claim and derived user data before user creation.78 *Feature: @anttileppa - State time limit can now be changed on the settings page.79 *Fix: @drzraf - Fix PHP notice when using traditional login, $token_response may be empty.80 * Fix: @drzraf - Fixed a notice when cookie does not contain expected redirect_url 98 - Feature: @drzraf - New filter hook: ability to filter claim and derived user data before user creation. 99 - Feature: @anttileppa - State time limit can now be changed on the settings page. 100 - Fix: @drzraf - Fix PHP notice when using traditional login, $token_response may be empty. 101 - Fix: @drzraf - Fixed a notice when cookie does not contain expected redirect_url 81 102 82 103 **3.3.1** 83 104 84 *Prefixing classes for more efficient autoloading.85 *Avoid altering global wp_remote_post() parameters.86 *Minor metadata updates for wp.org105 - Prefixing classes for more efficient autoloading. 106 - Avoid altering global wp_remote_post() parameters. 107 - Minor metadata updates for wp.org 87 108 88 109 **3.3.0** 89 110 90 *Fix: @pjeby - Handle multiple user sessions better by using the `WP_Session_Tokens` object. Predecessor to fixes for multiple other issues: #49, #50, #51111 - Fix: @pjeby - Handle multiple user sessions better by using the `WP_Session_Tokens` object. Predecessor to fixes for multiple other issues: #49, #50, #51 91 112 92 113 **3.2.1** 93 114 94 *Bug fix: @svenvanhal - Exit after issuing redirect. Fixes #46115 - Bug fix: @svenvanhal - Exit after issuing redirect. Fixes #46 95 116 96 117 **3.2.0** 97 118 98 *Feature: @robbiepaul - trigger core action `wp_login` when user is logged in through this plugin99 *Feature: @moriyoshi - Determine the WP_User display name with replacement tokens on the settings page. Tokens can be any property of the user_claim.100 *Feature: New setting to set redirect URL when session expires.101 *Feature: @robbiepaul - New filter for modifying authentication URL102 *Fix: @cedrox - Adding id_token_hint to logout URL according to spec103 *Bug fix: Provide port to the request header when requesting the user_claim119 - Feature: @robbiepaul - trigger core action `wp_login` when user is logged in through this plugin 120 - Feature: @moriyoshi - Determine the WP_User display name with replacement tokens on the settings page. Tokens can be any property of the user_claim. 121 - Feature: New setting to set redirect URL when session expires. 122 - Feature: @robbiepaul - New filter for modifying authentication URL 123 - Fix: @cedrox - Adding id_token_hint to logout URL according to spec 124 - Bug fix: Provide port to the request header when requesting the user_claim 104 125 105 126 **3.1.0** 106 127 107 * Feature: @rwasef1830 - Refresh tokens 108 *Feature: @rwasef1830 - Integrated logout support with end_session endpoint109 *Feature: May use an alternate redirect_uri that doesn't rely on admin-ajax110 *Feature: @ahatherly - Support for IDP behind reverse proxy111 *Bug fix: @robertstaddon - case insensitive check for Bearer token112 *Bug fix: @rwasef1830 - "redirect to origin when auto-sso" cookie issue113 *Bug fix: @rwasef1830 - PHP Warnings headers already sent due to attempts to redirect and set cookies during login form message114 *Bug fix: @rwasef1830 - expire session when access_token expires if no refresh token found115 *UX fix: @rwasef1830 - Show login button on error redirect when using auto-sso128 - Feature: @rwasef1830 - Refresh tokens 129 - Feature: @rwasef1830 - Integrated logout support with end_session endpoint 130 - Feature: May use an alternate redirect_uri that doesn't rely on admin-ajax 131 - Feature: @ahatherly - Support for IDP behind reverse proxy 132 - Bug fix: @robertstaddon - case insensitive check for Bearer token 133 - Bug fix: @rwasef1830 - "redirect to origin when auto-sso" cookie issue 134 - Bug fix: @rwasef1830 - PHP Warnings headers already sent due to attempts to redirect and set cookies during login form message 135 - Bug fix: @rwasef1830 - expire session when access_token expires if no refresh token found 136 - UX fix: @rwasef1830 - Show login button on error redirect when using auto-sso 116 137 117 138 **3.0.8** 118 139 119 *Feature: @wgengarelly - Added `openid-connect-generic-update-user-using-current-claim` action hook allowing other plugins/themes140 - Feature: @wgengarelly - Added `openid-connect-generic-update-user-using-current-claim` action hook allowing other plugins/themes 120 141 to take action using the fresh claims received when an existing user logs in. 121 142 122 143 **3.0.7** 123 144 124 * Bug fix: @wgengarelly - When requesting userinfo, send the access token using the Authorization header field as recommended in 125 section 5.3.1 of the specs. 145 - Bug fix: @wgengarelly - When requesting userinfo, send the access token using the Authorization header field as recommended in 146 section 5.3.1 of the specs. 126 147 127 148 **3.0.6** 128 149 129 *Bug fix: @robertstaddon - If "Link Existing Users" is enabled, allow users who login with OpenID Connect to also log in with WordPress credentials150 - Bug fix: @robertstaddon - If "Link Existing Users" is enabled, allow users who login with OpenID Connect to also log in with WordPress credentials 130 151 131 152 **3.0.5** 132 153 133 *Feature: @robertstaddon - Added `[openid_connect_generic_login_button]` shortcode to allow the login button to be placed anywhere134 *Feature: @robertstaddon - Added setting to "Redirect Back to Origin Page" after a successful login instead of redirecting to the home page.154 - Feature: @robertstaddon - Added `[openid_connect_generic_login_button]` shortcode to allow the login button to be placed anywhere 155 - Feature: @robertstaddon - Added setting to "Redirect Back to Origin Page" after a successful login instead of redirecting to the home page. 135 156 136 157 **3.0.4** 137 158 138 *Feature: @robertstaddon - Added setting to allow linking existing WordPress user accounts with newly-authenticated OpenID Connect login159 - Feature: @robertstaddon - Added setting to allow linking existing WordPress user accounts with newly-authenticated OpenID Connect login 139 160 140 161 **3.0.3** 141 162 142 *Using WordPresss's is_ssl() for setcookie()'s "secure" parameter143 *Bug fix: Incrementing username in case of collision.144 *Bug fix: Wrong error sent when missing token body163 - Using WordPresss's is_ssl() for setcookie()'s "secure" parameter 164 - Bug fix: Incrementing username in case of collision. 165 - Bug fix: Wrong error sent when missing token body 145 166 146 167 **3.0.2** 147 168 148 *Added http_request_timeout setting169 - Added http_request_timeout setting 149 170 150 171 **3.0.1** 151 172 152 *Finalizing 3.0.x api173 - Finalizing 3.0.x api 153 174 154 175 **3.0** 155 176 156 *Complete rewrite to separate concerns157 *Changed settings keys for clarity (requires updating settings if upgrading from another version)158 *Error logging177 - Complete rewrite to separate concerns 178 - Changed settings keys for clarity (requires updating settings if upgrading from another version) 179 - Error logging 159 180 160 181 **2.1** 161 182 162 * Working my way closer to spec. Possible breaking change.Now checking for preferred_username as priority.163 *New username determination to avoid collisions183 - Working my way closer to spec. Possible breaking change. Now checking for preferred_username as priority. 184 - New username determination to avoid collisions 164 185 165 186 **2.0** 166 187 167 188 Complete rewrite 168 -
daggerhart-openid-connect-generic/tags/3.9.0/includes/openid-connect-generic-client-wrapper.php
r2516022 r2698055 149 149 */ 150 150 public function get_redirect_to() { 151 // @var WP $wp WordPress environment setup class. 151 152 global $wp; 152 153 … … 171 172 if ( $this->settings->redirect_user_back ) { 172 173 if ( ! empty( $wp->request ) ) { 173 if ( ! empty( $wp->did_permalink ) && $wp->did_permalink) {174 $redirect_url = home_url( trailingslashit( $wp->request) );174 if ( ! empty( $wp->did_permalink ) && boolval( $wp->did_permalink ) === true ) { 175 $redirect_url = home_url( add_query_arg( $_GET, trailingslashit( $wp->request ) ) ); 175 176 } else { 176 177 $redirect_url = home_url( add_query_arg( null, null ) ); … … 211 212 'redirect_uri' => $this->client->get_redirect_uri(), 212 213 'redirect_to' => $this->get_redirect_to(), 214 'acr_values' => $this->settings->acr_values, 213 215 ), 214 216 $atts, … … 225 227 $separator = '&'; 226 228 } 229 230 $url_format = '%1$s%2$sresponse_type=code&scope=%3$s&client_id=%4$s&state=%5$s&redirect_uri=%6$s'; 231 if ( ! empty( $atts['acr_values'] ) ) { 232 $url_format .= '&acr_values=%7$s'; 233 } 234 227 235 $url = sprintf( 228 '%1$s%2$sresponse_type=code&scope=%3$s&client_id=%4$s&state=%5$s&redirect_uri=%6$s',236 $url_format, 229 237 $atts['endpoint_login'], 230 238 $separator, … … 232 240 rawurlencode( $atts['client_id'] ), 233 241 $this->client->new_state( $atts['redirect_to'] ), 234 rawurlencode( $atts['redirect_uri'] ) 242 rawurlencode( $atts['redirect_uri'] ), 243 rawurlencode( $atts['acr_values'] ) 235 244 ); 236 245 … … 272 281 273 282 if ( ! $refresh_token || ( $refresh_expires && $current_time > $refresh_expires ) ) { 274 wp_logout(); 275 276 if ( $this->settings->redirect_on_logout ) { 277 $this->error_redirect( new WP_Error( 'access-token-expired', __( 'Session expired. Please login again.', 'daggerhart-openid-connect-generic' ) ) ); 283 if ( isset( $_SERVER['REQUEST_URI'] ) ) { 284 do_action( 'openid-connect-generic-session-expired', wp_get_current_user(), esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); 285 wp_logout(); 286 287 if ( $this->settings->redirect_on_logout ) { 288 $this->error_redirect( new WP_Error( 'access-token-expired', __( 'Session expired. Please login again.', 'daggerhart-openid-connect-generic' ) ) ); 289 } 290 291 return; 278 292 } 279 280 return;281 293 } 282 294 … … 295 307 } 296 308 309 update_user_meta( $user_id, 'openid-connect-generic-last-token-response', $token_response ); 297 310 $this->save_refresh_token( $manager, $token, $token_response ); 298 311 } … … 511 524 $user = $this->get_user_by_identity( $subject_identity ); 512 525 526 // A pre-existing IDP mapped user wasn't found. 513 527 if ( ! $user ) { 514 if ( $this->settings->create_if_does_not_exist ) { 528 // If linking existing users or creating new ones call the `create_new_user` method which handles both cases. 529 if ( $this->settings->link_existing_users || $this->settings->create_if_does_not_exist ) { 515 530 $user = $this->create_new_user( $subject_identity, $user_claim ); 516 531 if ( is_wp_error( $user ) ) { … … 520 535 $this->error_redirect( new WP_Error( 'identity-not-map-existing-user', __( 'User identity is not linked to an existing WordPress user.', 'daggerhart-openid-connect-generic' ), $user_claim ) ); 521 536 } 522 } else {523 // Allow plugins / themes to take action using current claims on existing user (e.g. update role).524 do_action( 'openid-connect-generic-update-user-using-current-claim', $user, $user_claim );525 537 } 526 538 … … 535 547 $this->login_user( $user, $token_response, $id_token_claim, $user_claim, $subject_identity ); 536 548 549 // Allow plugins / themes to take action once a user is logged in. 537 550 do_action( 'openid-connect-generic-user-logged-in', $user ); 538 551 … … 581 594 582 595 /** 596 * Refresh user claim. 597 * 598 * @param WP_User $user The user object. 599 * @param array $token_response The token response. 600 * 601 * @return WP_Error|array 602 */ 603 public function refresh_user_claim( $user, $token_response ) { 604 $client = $this->client; 605 606 /** 607 * The id_token is used to identify the authenticated user, e.g. for SSO. 608 * The access_token must be used to prove access rights to protected 609 * resources e.g. for the userinfo endpoint 610 */ 611 $id_token_claim = $client->get_id_token_claim( $token_response ); 612 613 // Allow for other plugins to alter data before validation. 614 $id_token_claim = apply_filters( 'openid-connect-modify-id-token-claim-before-validation', $id_token_claim ); 615 616 if ( is_wp_error( $id_token_claim ) ) { 617 return $id_token_claim; 618 } 619 620 // Validate our id_token has required values. 621 $valid = $client->validate_id_token_claim( $id_token_claim ); 622 623 if ( is_wp_error( $valid ) ) { 624 return $valid; 625 } 626 627 // If userinfo endpoint is set, exchange the token_response for a user_claim. 628 if ( ! empty( $this->settings->endpoint_userinfo ) && isset( $token_response['access_token'] ) ) { 629 $user_claim = $client->get_user_claim( $token_response ); 630 } else { 631 $user_claim = $id_token_claim; 632 } 633 634 if ( is_wp_error( $user_claim ) ) { 635 return $user_claim; 636 } 637 638 // Validate our user_claim has required values. 639 $valid = $client->validate_user_claim( $user_claim, $id_token_claim ); 640 641 if ( is_wp_error( $valid ) ) { 642 $this->error_redirect( $valid ); 643 return $valid; 644 } 645 646 // Store the tokens for future reference. 647 update_user_meta( $user->ID, 'openid-connect-generic-last-token-response', $token_response ); 648 update_user_meta( $user->ID, 'openid-connect-generic-last-id-token-claim', $id_token_claim ); 649 update_user_meta( $user->ID, 'openid-connect-generic-last-user-claim', $user_claim ); 650 651 return $user_claim; 652 } 653 654 /** 583 655 * Record user meta data, and provide an authorization cookie. 584 656 * … … 596 668 update_user_meta( $user->ID, 'openid-connect-generic-last-id-token-claim', $id_token_claim ); 597 669 update_user_meta( $user->ID, 'openid-connect-generic-last-user-claim', $user_claim ); 670 // Allow plugins / themes to take action using current claims on existing user (e.g. update role). 671 do_action( 'openid-connect-generic-update-user-using-current-claim', $user, $user_claim ); 598 672 599 673 // Create the WP session, so we know its token. … … 657 731 ), 658 732 ), 733 // Override the default blog_id (get_current_blog_id) to find users on different sites of a multisite install. 734 'blog_id' => 0, 659 735 ) 660 736 ); 661 737 662 // If we found anexisting users, grab the first one returned.738 // If we found existing users, grab the first one returned. 663 739 if ( $user_query->get_total() > 0 ) { 664 740 $users = $user_query->get_results(); … … 674 750 * @param array $user_claim The IDP authenticated user claim data. 675 751 * 676 * @return string|WP_Error |null752 * @return string|WP_Error 677 753 */ 678 754 private function get_username_from_claim( $user_claim ) { … … 684 760 if ( ! empty( $this->settings->identity_key ) && isset( $user_claim[ $this->settings->identity_key ] ) ) { 685 761 $desired_username = $user_claim[ $this->settings->identity_key ]; 686 } else if ( isset( $user_claim['preferred_username'] ) && ! empty( $user_claim['preferred_username'] ) ) { 762 } 763 if ( empty( $desired_username ) && isset( $user_claim['preferred_username'] ) && ! empty( $user_claim['preferred_username'] ) ) { 687 764 $desired_username = $user_claim['preferred_username']; 688 } else if ( isset( $user_claim['name'] ) && ! empty( $user_claim['name'] ) ) { 765 } 766 if ( empty( $desired_username ) && isset( $user_claim['name'] ) && ! empty( $user_claim['name'] ) ) { 689 767 $desired_username = $user_claim['name']; 690 } else if ( isset( $user_claim['email'] ) && ! empty( $user_claim['email'] ) ) { 768 } 769 if ( empty( $desired_username ) && isset( $user_claim['email'] ) && ! empty( $user_claim['email'] ) ) { 691 770 $tmp = explode( '@', $user_claim['email'] ); 692 771 $desired_username = $tmp[0]; 693 } else { 772 } 773 if ( empty( $desired_username ) ) { 694 774 // Nothing to build a name from. 695 775 return new WP_Error( 'no-username', __( 'No appropriate username found.', 'daggerhart-openid-connect-generic' ), $user_claim ); 696 776 } 697 777 698 // Normalize the data a bit. 699 // @var string $transliterated_username The username converted to ASCII from UTF-8. 700 $transliterated_username = iconv( 'UTF-8', 'ASCII//TRANSLIT', $desired_username ); 701 if ( empty( $transliterated_username ) ) { 702 // translators: $1$s is a username from the IDP. 703 return new WP_Error( 'username-transliteration-failed', sprintf( __( 'Username %1$s could not be transliterated.', 'daggerhart-openid-connect-generic' ), $desired_username ), $desired_username ); 704 } 705 $normalized_username = strtolower( preg_replace( '/[^a-zA-Z0-9 _.\-@]/', '', $transliterated_username ) ); 706 if ( empty( $normalized_username ) ) { 707 // translators: %1$s is the ASCII version of the username from the IDP. 708 return new WP_Error( 'username-normalization-failed', sprintf( __( 'Username %1$s could not be normalized.', 'daggerhart-openid-connect-generic' ), $transliterated_username ), $transliterated_username ); 709 } 710 711 // Copy the username for incrementing. 712 $username = ! empty( $normalized_username ) ? $normalized_username : null; 713 714 if ( ! $this->settings->link_existing_users && ! is_null( $username ) ) { 715 // @example Original user gets "name", second user gets "name2", etc. 716 $count = 1; 717 while ( username_exists( $username ) ) { 718 $count ++; 719 $username = $normalized_username . $count; 720 } 721 } 722 723 return $username; 778 // Don't use the full email address for a username. 779 $_desired_username = explode( '@', $desired_username ); 780 $desired_username = $_desired_username[0]; 781 // Use WordPress Core to sanitize the IDP username. 782 $sanitized_username = sanitize_user( $desired_username, true ); 783 if ( empty( $sanitized_username ) ) { 784 // translators: %1$s is the santitized version of the username from the IDP. 785 return new WP_Error( 'username-sanitization-failed', sprintf( __( 'Username %1$s could not be sanitized.', 'daggerhart-openid-connect-generic' ), $desired_username ), $desired_username ); 786 } 787 788 return $sanitized_username; 724 789 } 725 790 … … 747 812 748 813 /** 814 * Checks if $claimname is in the body or _claim_names of the userinfo. 815 * If yes, returns the claim value. Otherwise, returns false. 816 * 817 * @param string $claimname the claim name to look for. 818 * @param array $userinfo the JSON to look in. 819 * @param string $claimvalue the source claim value ( from the body of the JWT of the claim source). 820 * @return true|false 821 */ 822 private function get_claim( $claimname, $userinfo, &$claimvalue ) { 823 /** 824 * If we find a simple claim, return it. 825 */ 826 if ( array_key_exists( $claimname, $userinfo ) ) { 827 $claimvalue = $userinfo[ $claimname ]; 828 return true; 829 } 830 /** 831 * If there are no aggregated claims, it is over. 832 */ 833 if ( ! array_key_exists( '_claim_names', $userinfo ) || 834 ! array_key_exists( '_claim_sources', $userinfo ) ) { 835 return false; 836 } 837 $claim_src_ptr = $userinfo['_claim_names']; 838 if ( ! isset( $claim_src_ptr ) ) { 839 return false; 840 } 841 /** 842 * No reference found 843 */ 844 if ( ! array_key_exists( $claimname, $claim_src_ptr ) ) { 845 return false; 846 } 847 $src_name = $claim_src_ptr[ $claimname ]; 848 // Reference found, but no corresponding JWT. This is a malformed userinfo. 849 if ( ! array_key_exists( $src_name, $userinfo['_claim_sources'] ) ) { 850 return false; 851 } 852 $src = $userinfo['_claim_sources'][ $src_name ]; 853 // Source claim is not a JWT. Abort. 854 if ( ! array_key_exists( 'JWT', $src ) ) { 855 return false; 856 } 857 /** 858 * Extract claim from JWT. 859 * FIXME: We probably want to verify the JWT signature/issuer here. 860 * For example, using JWKS if applicable. For symmetrically signed 861 * JWTs (HMAC), we need a way to specify the acceptable secrets 862 * and each possible issuer in the config. 863 */ 864 $jwt = $src['JWT']; 865 list ( $header, $body, $rest ) = explode( '.', $jwt, 3 ); 866 $body_str = base64_decode( $body, false ); 867 if ( ! $body_str ) { 868 return false; 869 } 870 $body_json = json_decode( $body_str, true ); 871 if ( ! isset( $body_json ) ) { 872 return false; 873 } 874 if ( ! array_key_exists( $claimname, $body_json ) ) { 875 return false; 876 } 877 $claimvalue = $body_json[ $claimname ]; 878 return true; 879 } 880 881 882 /** 749 883 * Build a string from the user claim according to the specified format. 750 884 * … … 758 892 $matches = null; 759 893 $string = ''; 894 $info = ''; 760 895 $i = 0; 761 896 if ( preg_match_all( '/\{[^}]*\}/u', $format, $matches, PREG_OFFSET_CAPTURE ) ) { … … 763 898 $key = substr( $match[0], 1, -1 ); 764 899 $string .= substr( $format, $i, $match[1] - $i ); 765 if ( ! isset( $user_claim[ $key ]) ) {900 if ( ! $this->get_claim( $key, $user_claim, $info ) ) { 766 901 if ( $error_on_missing_key ) { 767 902 return new WP_Error( … … 777 912 } 778 913 } else { 779 $string .= $ user_claim[ $key ];914 $string .= $info; 780 915 } 781 916 $i = $match[1] + strlen( $match[0] ); … … 836 971 // Allow claim details to determine username, email, nickname and displayname. 837 972 $_email = $this->get_email_from_claim( $user_claim, true ); 838 if ( is_wp_error( $_email ) ) {973 if ( is_wp_error( $_email ) || empty( $_email ) ) { 839 974 $values_missing = true; 840 } else if ( ! is_null( $_email ) ){975 } else { 841 976 $email = $_email; 842 977 } 843 978 844 979 $_username = $this->get_username_from_claim( $user_claim ); 845 if ( is_wp_error( $_username ) ) {980 if ( is_wp_error( $_username ) || empty( $_username ) ) { 846 981 $values_missing = true; 847 } else if ( ! is_null( $_username ) ){982 } else { 848 983 $username = $_username; 849 984 } 850 985 851 986 $_nickname = $this->get_nickname_from_claim( $user_claim ); 852 if ( is_ null( $_nickname ) ) {987 if ( is_wp_error( $_nickname ) || empty( $_nickname ) ) { 853 988 $values_missing = true; 854 989 } else { … … 857 992 858 993 $_displayname = $this->get_displayname_from_claim( $user_claim, true ); 859 if ( is_wp_error( $_displayname ) ) {994 if ( is_wp_error( $_displayname ) || empty( $_displayname ) ) { 860 995 $values_missing = true; 861 } else if ( ! is_null( $_displayname ) ){996 } else { 862 997 $displayname = $_displayname; 863 998 } … … 878 1013 if ( is_wp_error( $_email ) ) { 879 1014 return $_email; 880 } else if ( ! is_null( $_email ) ) { 1015 } 1016 // Use the email address from the latest userinfo request if not empty. 1017 if ( ! empty( $_email ) ) { 881 1018 $email = $_email; 882 1019 } … … 885 1022 if ( is_wp_error( $_username ) ) { 886 1023 return $_username; 887 } else if ( ! is_null( $_username ) ) { 1024 } 1025 // Use the username from the latest userinfo request if not empty. 1026 if ( ! empty( $_username ) ) { 888 1027 $username = $_username; 889 1028 } … … 892 1031 if ( is_wp_error( $_nickname ) ) { 893 1032 return $_nickname; 894 } else if ( is_null( $_nickname ) ) { 1033 } 1034 // Use the username as the nickname if the userinfo request nickname is empty. 1035 if ( empty( $_nickname ) ) { 895 1036 $nickname = $username; 896 1037 } … … 899 1040 if ( is_wp_error( $_displayname ) ) { 900 1041 return $_displayname; 901 } else if ( is_null( $_displayname ) ) { 1042 } 1043 // Use the nickname as the displayname if the userinfo request displayname is empty. 1044 if ( empty( $_displayname ) ) { 902 1045 $displayname = $nickname; 903 1046 } 904 1047 905 // Before trying to create the user, first check if a user with the same email alreadyexists.1048 // Before trying to create the user, first check if a matching user exists. 906 1049 if ( $this->settings->link_existing_users ) { 1050 $uid = null; 907 1051 if ( $this->settings->identify_with_username ) { 908 1052 $uid = username_exists( $username ); … … 910 1054 $uid = email_exists( $email ); 911 1055 } 912 if ( $uid) {1056 if ( ! empty( $uid ) ) { 913 1057 $user = $this->update_existing_user( $uid, $subject_identity ); 914 1058 do_action( 'openid-connect-generic-update-user-using-current-claim', $user, $user_claim ); … … 921 1065 * based on the returned user claim. 922 1066 */ 923 $create_user = apply_filters( 'openid-connect-generic-user-creation-test', true, $user_claim );1067 $create_user = apply_filters( 'openid-connect-generic-user-creation-test', $this->settings->create_if_does_not_exist, $user_claim ); 924 1068 925 1069 if ( ! $create_user ) { 926 1070 return new WP_Error( 'cannot-authorize', __( 'Can not authorize.', 'daggerhart-openid-connect-generic' ), $create_user ); 1071 } 1072 1073 // Copy the username for incrementing. 1074 $_username = $username; 1075 // Ensure prevention of linking usernames & collisions by incrementing the username if it exists. 1076 // @example Original user gets "name", second user gets "name2", etc. 1077 $count = 1; 1078 while ( username_exists( $username ) ) { 1079 $count ++; 1080 $username = $_username . $count; 927 1081 } 928 1082 -
daggerhart-openid-connect-generic/tags/3.9.0/includes/openid-connect-generic-client.php
r2516022 r2698055 84 84 85 85 /** 86 * The specifically requested authentication contract at the IDP 87 * 88 * @see OpenID_Connect_Generic_Option_Settings::acr_values 89 * 90 * @var string 91 */ 92 private $acr_values; 93 94 /** 86 95 * The state time limit. States are only valid for 3 minutes. 87 96 * … … 109 118 * @param string $endpoint_token @see OpenID_Connect_Generic_Option_Settings::endpoint_token for description. 110 119 * @param string $redirect_uri @see OpenID_Connect_Generic_Option_Settings::redirect_uri for description. 120 * @param string $acr_values @see OpenID_Connect_Generic_Option_Settings::acr_values for description. 111 121 * @param int $state_time_limit @see OpenID_Connect_Generic_Option_Settings::state_time_limit for description. 112 122 * @param OpenID_Connect_Generic_Option_Logger $logger The plugin logging object instance. 113 123 */ 114 public function __construct( $client_id, $client_secret, $scope, $endpoint_login, $endpoint_userinfo, $endpoint_token, $redirect_uri, $ state_time_limit, $logger ) {124 public function __construct( $client_id, $client_secret, $scope, $endpoint_login, $endpoint_userinfo, $endpoint_token, $redirect_uri, $acr_values, $state_time_limit, $logger ) { 115 125 $this->client_id = $client_id; 116 126 $this->client_secret = $client_secret; … … 120 130 $this->endpoint_token = $endpoint_token; 121 131 $this->redirect_uri = $redirect_uri; 132 $this->acr_values = $acr_values; 122 133 $this->state_time_limit = $state_time_limit; 123 134 $this->logger = $logger; … … 213 224 ); 214 225 226 if ( ! empty( $this->acr_values ) ) { 227 $request['body'] += array( 'acr_values' => $this->acr_values ); 228 } 229 215 230 // Allow modifications to the request. 216 231 $request = apply_filters( 'openid-connect-generic-alter-request', $request, 'get-authentication-token' ); … … 465 480 } 466 481 482 // Validate acr values when the option is set in the configuration. 483 if ( ! empty( $this->acr_values ) && isset( $id_token_claim['acr'] ) ) { 484 if ( $this->acr_values != $id_token_claim['acr'] ) { 485 return new WP_Error( 'no-match-acr', __( 'No matching acr values.', 'daggerhart-openid-connect-generic' ), $id_token_claim ); 486 } 487 } 488 467 489 return true; 468 490 } -
daggerhart-openid-connect-generic/tags/3.9.0/includes/openid-connect-generic-option-settings.php
r2511857 r2698055 34 34 * @property string $endpoint_token The IDP token validation endpoint URL. 35 35 * @property string $endpoint_end_session The IDP logout endpoint URL. 36 * @property string $acr_values The Authentication contract as defined on the IDP. 36 37 * 37 38 * Non-standard Settings: … … 87 88 */ 88 89 private $environment_settings = array( 89 'client_id' => 'OIDC_CLIENT_ID', 90 'client_secret' => 'OIDC_CLIENT_SECRET', 91 'endpoint_login' => 'OIDC_ENDPOINT_LOGIN_URL', 92 'endpoint_userinfo' => 'OIDC_ENDPOINT_USERINFO_URL', 93 'endpoint_token' => 'OIDC_ENDPOINT_TOKEN_URL', 94 'endpoint_end_session' => 'OIDC_ENDPOINT_LOGOUT_URL', 90 'client_id' => 'OIDC_CLIENT_ID', 91 'client_secret' => 'OIDC_CLIENT_SECRET', 92 'endpoint_end_session' => 'OIDC_ENDPOINT_LOGOUT_URL', 93 'endpoint_login' => 'OIDC_ENDPOINT_LOGIN_URL', 94 'endpoint_token' => 'OIDC_ENDPOINT_TOKEN_URL', 95 'endpoint_userinfo' => 'OIDC_ENDPOINT_USERINFO_URL', 96 'login_type' => 'OIDC_LOGIN_TYPE', 97 'scope' => 'OIDC_CLIENT_SCOPE', 98 'create_if_does_not_exist' => 'OIDC_CREATE_IF_DOES_NOT_EXIST', 99 'enforce_privacy' => 'OIDC_ENFORCE_PRIVACY', 100 'link_existing_users' => 'OIDC_LINK_EXISTING_USERS', 101 'redirect_on_logout' => 'OIDC_REDIRECT_ON_LOGOUT', 102 'redirect_user_back' => 'OIDC_REDIRECT_USER_BACK', 103 'acr_values' => 'OIDC_ACR_VALUES', 95 104 ); 96 105 -
daggerhart-openid-connect-generic/tags/3.9.0/includes/openid-connect-generic-settings-page.php
r2511857 r2698055 217 217 'auto' => __( 'Auto Login - SSO', 'daggerhart-openid-connect-generic' ), 218 218 ), 219 'disabled' => defined( 'OIDC_LOGIN_TYPE' ), 219 220 'section' => 'client_settings', 220 221 ), … … 239 240 'example' => 'email profile openid offline_access', 240 241 'type' => 'text', 242 'disabled' => defined( 'OIDC_CLIENT_SCOPE' ), 241 243 'section' => 'client_settings', 242 244 ), … … 273 275 'section' => 'client_settings', 274 276 ), 277 'acr_values' => array( 278 'title' => __( 'ACR values', 'daggerhart-openid-connect-generic' ), 279 'description' => __( 'Use a specific defined authentication contract from the IDP - optional.', 'daggerhart-openid-connect-generic' ), 280 'type' => 'text', 281 'disabled' => defined( 'OIDC_ACR_VALUES' ), 282 'section' => 'client_settings', 283 ), 275 284 'identity_key' => array( 276 285 'title' => __( 'Identity Key', 'daggerhart-openid-connect-generic' ), … … 298 307 'description' => __( 'Require users be logged in to see the site.', 'daggerhart-openid-connect-generic' ), 299 308 'type' => 'checkbox', 309 'disabled' => defined( 'OIDC_ENFORCE_PRIVACY' ), 300 310 'section' => 'authorization_settings', 301 311 ), … … 349 359 'description' => __( 'If a WordPress account already exists with the same identity as a newly-authenticated user over OpenID Connect, login as that user instead of generating an error.', 'daggerhart-openid-connect-generic' ), 350 360 'type' => 'checkbox', 361 'disabled' => defined( 'OIDC_LINK_EXISTING_USERS' ), 351 362 'section' => 'user_settings', 352 363 ), 353 364 'create_if_does_not_exist' => array( 354 365 'title' => __( 'Create user if does not exist', 'daggerhart-openid-connect-generic' ), 355 'description' => __( 'If the user identity is not link to an existing Wordpress user, it is created. If this setting is not enabled and if the user authenticates with an account which is not link to an existing Wordpress user then the authentication failed', 'daggerhart-openid-connect-generic' ), 356 'type' => 'checkbox', 366 'description' => __( 'If the user identity is not linked to an existing WordPress user, it is created. If this setting is not enabled, and if the user authenticates with an account which is not linked to an existing WordPress user, then the authentication will fail.', 'daggerhart-openid-connect-generic' ), 367 'type' => 'checkbox', 368 'disabled' => defined( 'OIDC_CREATE_IF_DOES_NOT_EXIST' ), 357 369 'section' => 'user_settings', 358 370 ), … … 361 373 'description' => __( 'After a successful OpenID Connect authentication, this will redirect the user back to the page on which they clicked the OpenID Connect login button. This will cause the login process to proceed in a traditional WordPress fashion. For example, users logging in through the default wp-login.php page would end up on the WordPress Dashboard and users logging in through the WooCommerce "My Account" page would end up on their account page.', 'daggerhart-openid-connect-generic' ), 362 374 'type' => 'checkbox', 375 'disabled' => defined( 'OIDC_REDIRECT_USER_BACK' ), 363 376 'section' => 'user_settings', 364 377 ), … … 367 380 'description' => __( 'When enabled, this will automatically redirect the user back to the WordPress login page if their access token has expired.', 'daggerhart-openid-connect-generic' ), 368 381 'type' => 'checkbox', 382 'disabled' => defined( 'OIDC_REDIRECT_ON_LOGOUT' ), 369 383 'section' => 'user_settings', 370 384 ), … … 415 429 */ 416 430 public function settings_page() { 431 wp_enqueue_style( 'daggerhart-openid-connect-generic-admin', plugin_dir_url( __DIR__ ) . 'css/styles-admin.css', array(), OpenID_Connect_Generic::VERSION, 'all' ); 432 417 433 $redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); 418 434 … … 473 489 ?> 474 490 <input type="<?php print esc_attr( $field['type'] ); ?>" 475 <?php echo ( ! empty( $field['disabled'] ) && boolval( $field['disabled'] ) ) ? ' disabled' : ''; ?>491 <?php echo ( ! empty( $field['disabled'] ) && boolval( $field['disabled'] ) === true ) ? ' disabled' : ''; ?> 476 492 id="<?php print esc_attr( $field['key'] ); ?>" 477 class="large-text<?php echo ( ! empty( $field['disabled'] ) && boolval( $field['disabled'] ) ) ? ' disabled' : ''; ?>"493 class="large-text<?php echo ( ! empty( $field['disabled'] ) && boolval( $field['disabled'] ) === true ) ? ' disabled' : ''; ?>" 478 494 name="<?php print esc_attr( $field['name'] ); ?>" 479 495 value="<?php print esc_attr( $this->settings->{ $field['key'] } ); ?>"> … … 531 547 ?> 532 548 <p class="description"> 533 <?php print esc_html( $field['description'] ); ?>549 <?php print wp_kses_post( $field['description'] ); ?> 534 550 <?php if ( isset( $field['example'] ) ) : ?> 535 551 <br/><strong><?php esc_html_e( 'Example', 'daggerhart-openid-connect-generic' ); ?>: </strong> -
daggerhart-openid-connect-generic/tags/3.9.0/languages/openid-connect-generic.pot
r2516022 r2698055 1 # Copyright (C) 202 1daggerhart1 # Copyright (C) 2022 daggerhart 2 2 # This file is distributed under the GPL-2.0+. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: OpenID Connect Generic 3. 8.5\n"5 "Project-Id-Version: OpenID Connect Generic 3.9.0\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://github.com/daggerhart/openid-connect-generic/issues\n" 8 "POT-Creation-Date: 202 1-04-16 03:38:39+00:00\n"8 "POT-Creation-Date: 2022-03-22 03:28:37+00:00\n" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=utf-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "PO-Revision-Date: 202 1-MO-DA HO:MI+ZONE\n"12 "PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 14 "Language-Team: LANGUAGE <LL@li.org>\n" … … 26 26 "X-Generator: grunt-wp-i18n 1.0.3\n" 27 27 28 #: includes/openid-connect-generic-client-wrapper.php:2 7728 #: includes/openid-connect-generic-client-wrapper.php:288 29 29 msgid "Session expired. Please login again." 30 30 msgstr "" 31 31 32 #: includes/openid-connect-generic-client-wrapper.php:5 2032 #: includes/openid-connect-generic-client-wrapper.php:535 33 33 msgid "User identity is not linked to an existing WordPress user." 34 34 msgstr "" 35 35 36 #: includes/openid-connect-generic-client-wrapper.php:5 7636 #: includes/openid-connect-generic-client-wrapper.php:589 37 37 msgid "Invalid user." 38 38 msgstr "" 39 39 40 #: includes/openid-connect-generic-client-wrapper.php: 69540 #: includes/openid-connect-generic-client-wrapper.php:775 41 41 msgid "No appropriate username found." 42 42 msgstr "" 43 43 44 #: includes/openid-connect-generic-client-wrapper.php:703 45 #. translators: $1$s is a username from the IDP. 46 msgid "Username %1$s could not be transliterated." 47 msgstr "" 48 49 #: includes/openid-connect-generic-client-wrapper.php:708 50 #. translators: %1$s is the ASCII version of the username from the IDP. 51 msgid "Username %1$s could not be normalized." 52 msgstr "" 53 54 #: includes/openid-connect-generic-client-wrapper.php:742 44 #: includes/openid-connect-generic-client-wrapper.php:785 45 #. translators: %1$s is the santitized version of the username from the IDP. 46 msgid "Username %1$s could not be sanitized." 47 msgstr "" 48 49 #: includes/openid-connect-generic-client-wrapper.php:807 55 50 #. translators: %1$s is the configured User Claim nickname key. 56 51 msgid "No nickname found in user claim using key: %1$s." 57 52 msgstr "" 58 53 59 #: includes/openid-connect-generic-client-wrapper.php: 76954 #: includes/openid-connect-generic-client-wrapper.php:904 60 55 msgid "User claim incomplete." 61 56 msgstr "" 62 57 63 #: includes/openid-connect-generic-client-wrapper.php: 87158 #: includes/openid-connect-generic-client-wrapper.php:1006 64 59 msgid "Bad user claim result." 65 60 msgstr "" 66 61 67 #: includes/openid-connect-generic-client-wrapper.php: 92662 #: includes/openid-connect-generic-client-wrapper.php:1070 68 63 msgid "Can not authorize." 69 64 msgstr "" 70 65 71 #: includes/openid-connect-generic-client-wrapper.php: 94566 #: includes/openid-connect-generic-client-wrapper.php:1099 72 67 msgid "Failed user creation." 73 68 msgstr "" 74 69 75 #: includes/openid-connect-generic-client.php:1 6570 #: includes/openid-connect-generic-client.php:176 76 71 msgid "Missing state." 77 72 msgstr "" 78 73 79 #: includes/openid-connect-generic-client.php:1 6974 #: includes/openid-connect-generic-client.php:180 80 75 msgid "Invalid state." 81 76 msgstr "" 82 77 83 #: includes/openid-connect-generic-client.php:1 8478 #: includes/openid-connect-generic-client.php:195 84 79 msgid "Missing authentication code." 85 80 msgstr "" 86 81 87 #: includes/openid-connect-generic-client.php:2 2382 #: includes/openid-connect-generic-client.php:238 88 83 msgid "Request for authentication token failed." 89 84 msgstr "" 90 85 91 #: includes/openid-connect-generic-client.php:2 5486 #: includes/openid-connect-generic-client.php:269 92 87 msgid "Refresh token failed." 93 88 msgstr "" 94 89 95 #: includes/openid-connect-generic-client.php:2 6990 #: includes/openid-connect-generic-client.php:284 96 91 msgid "Missing token body." 97 92 msgstr "" 98 93 99 #: includes/openid-connect-generic-client.php:2 7794 #: includes/openid-connect-generic-client.php:292 100 95 msgid "Invalid token." 101 96 msgstr "" 102 97 103 #: includes/openid-connect-generic-client.php:3 2898 #: includes/openid-connect-generic-client.php:343 104 99 msgid "Request for userinfo failed." 105 100 msgstr "" 106 101 107 #: includes/openid-connect-generic-client.php: 388102 #: includes/openid-connect-generic-client.php:403 108 103 msgid "Missing authentication state." 109 104 msgstr "" 110 105 111 #: includes/openid-connect-generic-client.php:4 25106 #: includes/openid-connect-generic-client.php:440 112 107 msgid "No identity token." 113 108 msgstr "" 114 109 115 #: includes/openid-connect-generic-client.php:4 32110 #: includes/openid-connect-generic-client.php:447 116 111 msgid "Missing identity token." 117 112 msgstr "" 118 113 119 #: includes/openid-connect-generic-client.php:4 59114 #: includes/openid-connect-generic-client.php:474 120 115 msgid "Bad ID token claim." 121 116 msgstr "" 122 117 123 #: includes/openid-connect-generic-client.php:4 64118 #: includes/openid-connect-generic-client.php:479 124 119 msgid "No subject identity." 125 120 msgstr "" 126 121 127 #: includes/openid-connect-generic-client.php:483 122 #: includes/openid-connect-generic-client.php:485 123 msgid "No matching acr values." 124 msgstr "" 125 126 #: includes/openid-connect-generic-client.php:505 128 127 msgid "Bad user claim." 129 128 msgstr "" 130 129 131 #: includes/openid-connect-generic-client.php:5 03130 #: includes/openid-connect-generic-client.php:525 132 131 msgid "Invalid user claim." 133 132 msgstr "" 134 133 135 #: includes/openid-connect-generic-client.php:5 08134 #: includes/openid-connect-generic-client.php:530 136 135 msgid "Error from the IDP." 137 136 msgstr "" 138 137 139 #: includes/openid-connect-generic-client.php:5 17138 #: includes/openid-connect-generic-client.php:539 140 139 msgid "Incorrect user claim." 141 140 msgstr "" 142 141 143 #: includes/openid-connect-generic-client.php:5 24142 #: includes/openid-connect-generic-client.php:546 144 143 msgid "Unauthorized access." 145 144 msgstr "" … … 210 209 msgstr "" 211 210 212 #: includes/openid-connect-generic-settings-page.php:22 2211 #: includes/openid-connect-generic-settings-page.php:223 213 212 msgid "Client ID" 214 213 msgstr "" 215 214 216 #: includes/openid-connect-generic-settings-page.php:22 3215 #: includes/openid-connect-generic-settings-page.php:224 217 216 msgid "" 218 217 "The ID this client will be recognized as when connecting the to Identity " … … 220 219 msgstr "" 221 220 222 #: includes/openid-connect-generic-settings-page.php:23 0221 #: includes/openid-connect-generic-settings-page.php:231 223 222 msgid "Client Secret Key" 224 223 msgstr "" 225 224 226 #: includes/openid-connect-generic-settings-page.php:23 1225 #: includes/openid-connect-generic-settings-page.php:232 227 226 msgid "" 228 227 "Arbitrary secret key the server expects from this client. Can be anything, " … … 230 229 msgstr "" 231 230 232 #: includes/openid-connect-generic-settings-page.php:23 7231 #: includes/openid-connect-generic-settings-page.php:238 233 232 msgid "OpenID Scope" 234 233 msgstr "" 235 234 236 #: includes/openid-connect-generic-settings-page.php:23 8235 #: includes/openid-connect-generic-settings-page.php:239 237 236 msgid "Space separated list of scopes this client should access." 238 237 msgstr "" 239 238 240 #: includes/openid-connect-generic-settings-page.php:24 4239 #: includes/openid-connect-generic-settings-page.php:246 241 240 msgid "Login Endpoint URL" 242 241 msgstr "" 243 242 244 #: includes/openid-connect-generic-settings-page.php:24 5243 #: includes/openid-connect-generic-settings-page.php:247 245 244 msgid "Identify provider authorization endpoint." 246 245 msgstr "" 247 246 248 #: includes/openid-connect-generic-settings-page.php:25 2247 #: includes/openid-connect-generic-settings-page.php:254 249 248 msgid "Userinfo Endpoint URL" 250 249 msgstr "" 251 250 252 #: includes/openid-connect-generic-settings-page.php:25 3251 #: includes/openid-connect-generic-settings-page.php:255 253 252 msgid "Identify provider User information endpoint." 254 253 msgstr "" 255 254 256 #: includes/openid-connect-generic-settings-page.php:26 0255 #: includes/openid-connect-generic-settings-page.php:262 257 256 msgid "Token Validation Endpoint URL" 258 257 msgstr "" 259 258 260 #: includes/openid-connect-generic-settings-page.php:26 1259 #: includes/openid-connect-generic-settings-page.php:263 261 260 msgid "Identify provider token endpoint." 262 261 msgstr "" 263 262 264 #: includes/openid-connect-generic-settings-page.php:2 68263 #: includes/openid-connect-generic-settings-page.php:270 265 264 msgid "End Session Endpoint URL" 266 265 msgstr "" 267 266 268 #: includes/openid-connect-generic-settings-page.php:2 69267 #: includes/openid-connect-generic-settings-page.php:271 269 268 msgid "Identify provider logout endpoint." 270 269 msgstr "" 271 270 272 #: includes/openid-connect-generic-settings-page.php:276 271 #: includes/openid-connect-generic-settings-page.php:278 272 msgid "ACR values" 273 msgstr "" 274 275 #: includes/openid-connect-generic-settings-page.php:279 276 msgid "Use a specific defined authentication contract from the IDP - optional." 277 msgstr "" 278 279 #: includes/openid-connect-generic-settings-page.php:285 273 280 msgid "Identity Key" 274 281 msgstr "" 275 282 276 #: includes/openid-connect-generic-settings-page.php:2 77283 #: includes/openid-connect-generic-settings-page.php:286 277 284 msgid "" 278 285 "Where in the user claim array to find the user's identification data. " … … 281 288 msgstr "" 282 289 283 #: includes/openid-connect-generic-settings-page.php:2 83290 #: includes/openid-connect-generic-settings-page.php:292 284 291 msgid "Disable SSL Verify" 285 292 msgstr "" 286 293 287 #: includes/openid-connect-generic-settings-page.php:2 85294 #: includes/openid-connect-generic-settings-page.php:294 288 295 #. translators: %1$s HTML tags for layout/styles, %2$s closing HTML tag for 289 296 #. styles. … … 296 303 msgstr "" 297 304 298 #: includes/openid-connect-generic-settings-page.php:29 0305 #: includes/openid-connect-generic-settings-page.php:299 299 306 msgid "HTTP Request Timeout" 300 307 msgstr "" 301 308 302 #: includes/openid-connect-generic-settings-page.php: 291309 #: includes/openid-connect-generic-settings-page.php:300 303 310 msgid "Set the timeout for requests made to the IDP. Default value is 5." 304 311 msgstr "" 305 312 306 #: includes/openid-connect-generic-settings-page.php: 297313 #: includes/openid-connect-generic-settings-page.php:306 307 314 msgid "Enforce Privacy" 308 315 msgstr "" 309 316 310 #: includes/openid-connect-generic-settings-page.php: 298317 #: includes/openid-connect-generic-settings-page.php:307 311 318 msgid "Require users be logged in to see the site." 312 319 msgstr "" 313 320 314 #: includes/openid-connect-generic-settings-page.php:3 03321 #: includes/openid-connect-generic-settings-page.php:313 315 322 msgid "Alternate Redirect URI" 316 323 msgstr "" 317 324 318 #: includes/openid-connect-generic-settings-page.php:3 04325 #: includes/openid-connect-generic-settings-page.php:314 319 326 msgid "" 320 327 "Provide an alternative redirect route. Useful if your server is causing " … … 324 331 msgstr "" 325 332 326 #: includes/openid-connect-generic-settings-page.php:3 09333 #: includes/openid-connect-generic-settings-page.php:319 327 334 msgid "Nickname Key" 328 335 msgstr "" 329 336 330 #: includes/openid-connect-generic-settings-page.php:3 10337 #: includes/openid-connect-generic-settings-page.php:320 331 338 msgid "" 332 339 "Where in the user claim array to find the user's nickname. Possible " … … 334 341 msgstr "" 335 342 336 #: includes/openid-connect-generic-settings-page.php:3 16343 #: includes/openid-connect-generic-settings-page.php:326 337 344 msgid "Email Formatting" 338 345 msgstr "" 339 346 340 #: includes/openid-connect-generic-settings-page.php:3 17347 #: includes/openid-connect-generic-settings-page.php:327 341 348 msgid "" 342 349 "String from which the user's email address is built. Specify \"{email}\" as " … … 344 351 msgstr "" 345 352 346 #: includes/openid-connect-generic-settings-page.php:3 23353 #: includes/openid-connect-generic-settings-page.php:333 347 354 msgid "Display Name Formatting" 348 355 msgstr "" 349 356 350 #: includes/openid-connect-generic-settings-page.php:3 24357 #: includes/openid-connect-generic-settings-page.php:334 351 358 msgid "String from which the user's display name is built." 352 359 msgstr "" 353 360 354 #: includes/openid-connect-generic-settings-page.php:3 30361 #: includes/openid-connect-generic-settings-page.php:340 355 362 msgid "Identify with User Name" 356 363 msgstr "" 357 364 358 #: includes/openid-connect-generic-settings-page.php:3 31365 #: includes/openid-connect-generic-settings-page.php:341 359 366 msgid "" 360 367 "If checked, the user's identity will be determined by the user name instead " … … 362 369 msgstr "" 363 370 364 #: includes/openid-connect-generic-settings-page.php:3 36371 #: includes/openid-connect-generic-settings-page.php:346 365 372 msgid "State time limit" 366 373 msgstr "" 367 374 368 #: includes/openid-connect-generic-settings-page.php:3 37375 #: includes/openid-connect-generic-settings-page.php:347 369 376 msgid "State valid time in seconds. Defaults to 180" 370 377 msgstr "" 371 378 372 #: includes/openid-connect-generic-settings-page.php:3 42379 #: includes/openid-connect-generic-settings-page.php:352 373 380 msgid "Enable Refresh Token" 374 381 msgstr "" 375 382 376 #: includes/openid-connect-generic-settings-page.php:3 43383 #: includes/openid-connect-generic-settings-page.php:353 377 384 msgid "" 378 385 "If checked, support refresh tokens used to obtain access tokens from " … … 380 387 msgstr "" 381 388 382 #: includes/openid-connect-generic-settings-page.php:3 48389 #: includes/openid-connect-generic-settings-page.php:358 383 390 msgid "Link Existing Users" 384 391 msgstr "" 385 392 386 #: includes/openid-connect-generic-settings-page.php:3 49393 #: includes/openid-connect-generic-settings-page.php:359 387 394 msgid "" 388 395 "If a WordPress account already exists with the same identity as a " … … 391 398 msgstr "" 392 399 393 #: includes/openid-connect-generic-settings-page.php:3 54400 #: includes/openid-connect-generic-settings-page.php:365 394 401 msgid "Create user if does not exist" 395 402 msgstr "" 396 403 397 #: includes/openid-connect-generic-settings-page.php:3 55398 msgid "" 399 "If the user identity is not link to an existing Wordpress user, it is "400 "created. If this setting is not enabled and if the user authenticates with "401 "an account which is not link to an existing Wordpress userthen the "402 "authentication failed"403 msgstr "" 404 405 #: includes/openid-connect-generic-settings-page.php:3 60404 #: includes/openid-connect-generic-settings-page.php:366 405 msgid "" 406 "If the user identity is not linked to an existing WordPress user, it is " 407 "created. If this setting is not enabled, and if the user authenticates with " 408 "an account which is not linked to an existing WordPress user, then the " 409 "authentication will fail." 410 msgstr "" 411 412 #: includes/openid-connect-generic-settings-page.php:372 406 413 msgid "Redirect Back to Origin Page" 407 414 msgstr "" 408 415 409 #: includes/openid-connect-generic-settings-page.php:3 61416 #: includes/openid-connect-generic-settings-page.php:373 410 417 msgid "" 411 418 "After a successful OpenID Connect authentication, this will redirect the " … … 418 425 msgstr "" 419 426 420 #: includes/openid-connect-generic-settings-page.php:3 66427 #: includes/openid-connect-generic-settings-page.php:379 421 428 msgid "Redirect to the login screen when session is expired" 422 429 msgstr "" 423 430 424 #: includes/openid-connect-generic-settings-page.php:3 67431 #: includes/openid-connect-generic-settings-page.php:380 425 432 msgid "" 426 433 "When enabled, this will automatically redirect the user back to the " … … 428 435 msgstr "" 429 436 430 #: includes/openid-connect-generic-settings-page.php:3 72437 #: includes/openid-connect-generic-settings-page.php:386 431 438 msgid "Enable Logging" 432 439 msgstr "" 433 440 434 #: includes/openid-connect-generic-settings-page.php:3 73441 #: includes/openid-connect-generic-settings-page.php:387 435 442 msgid "Very simple log messages for debugging purposes." 436 443 msgstr "" 437 444 438 #: includes/openid-connect-generic-settings-page.php:3 78445 #: includes/openid-connect-generic-settings-page.php:392 439 446 msgid "Log Limit" 440 447 msgstr "" 441 448 442 #: includes/openid-connect-generic-settings-page.php:3 79449 #: includes/openid-connect-generic-settings-page.php:393 443 450 msgid "" 444 451 "Number of items to keep in the log. These logs are stored as an option in " … … 446 453 msgstr "" 447 454 448 #: includes/openid-connect-generic-settings-page.php:4 39455 #: includes/openid-connect-generic-settings-page.php:455 449 456 msgid "Notes" 450 457 msgstr "" 451 458 452 #: includes/openid-connect-generic-settings-page.php:4 42459 #: includes/openid-connect-generic-settings-page.php:458 453 460 msgid "Redirect URI" 454 461 msgstr "" 455 462 456 #: includes/openid-connect-generic-settings-page.php:4 46463 #: includes/openid-connect-generic-settings-page.php:462 457 464 msgid "Login Button Shortcode" 458 465 msgstr "" 459 466 460 #: includes/openid-connect-generic-settings-page.php:4 50467 #: includes/openid-connect-generic-settings-page.php:466 461 468 msgid "Authentication URL Shortcode" 462 469 msgstr "" 463 470 464 #: includes/openid-connect-generic-settings-page.php:4 55471 #: includes/openid-connect-generic-settings-page.php:471 465 472 msgid "Logs" 466 473 msgstr "" 467 474 468 #: includes/openid-connect-generic-settings-page.php:5 35475 #: includes/openid-connect-generic-settings-page.php:551 469 476 msgid "Example" 470 477 msgstr "" 471 478 472 #: includes/openid-connect-generic-settings-page.php:5 48479 #: includes/openid-connect-generic-settings-page.php:564 473 480 msgid "Enter your OpenID Connect identity provider settings." 474 481 msgstr "" 475 482 476 #: includes/openid-connect-generic-settings-page.php:5 57483 #: includes/openid-connect-generic-settings-page.php:573 477 484 msgid "Modify the interaction between OpenID Connect and WordPress users." 478 485 msgstr "" 479 486 480 #: includes/openid-connect-generic-settings-page.php:5 66487 #: includes/openid-connect-generic-settings-page.php:582 481 488 msgid "Control the authorization mechanics of the site." 482 489 msgstr "" 483 490 484 #: includes/openid-connect-generic-settings-page.php:5 75491 #: includes/openid-connect-generic-settings-page.php:591 485 492 msgid "Log information about login attempts through OpenID Connect Generic." 486 493 msgstr "" 487 494 488 #: openid-connect-generic.php:2 02495 #: openid-connect-generic.php:213 489 496 msgid "Private site" 490 497 msgstr "" -
daggerhart-openid-connect-generic/tags/3.9.0/openid-connect-generic.php
r2516022 r2698055 17 17 * Plugin URI: https://github.com/daggerhart/openid-connect-generic 18 18 * Description: Connect to an OpenID Connect generic client using Authorization Code Flow. 19 * Version: 3.8.5 19 * Version: 3.9.0 20 * Requires at least: 4.9 21 * Requires PHP: 7.2 20 22 * Author: daggerhart 21 23 * Author URI: http://www.daggerhart.com … … 45 47 46 48 Actions 47 - openid-connect-generic-user-create - 2 args: fires when a new user is created by this plugin 48 - openid-connect-generic-user-update - 1 arg: user ID, fires when user is updated by this plugin 49 - openid-connect-generic-update-user-using-current-claim - 2 args: fires every time an existing user logs 50 - openid-connect-generic-redirect-user-back - 2 args: $redirect_url, $user. Allows interruption of redirect during login. 51 - openid-connect-generic-user-logged-in - 1 arg: $user, fires when user is logged in. 52 - openid-connect-generic-cron-daily - daily cron action 53 - openid-connect-generic-state-not-found - the given state does not exist in the database, regardless of its expiration. 54 - openid-connect-generic-state-expired - the given state exists, but expired before this login attempt. 49 - openid-connect-generic-user-create - 2 args: fires when a new user is created by this plugin 50 - openid-connect-generic-user-update - 1 arg: user ID, fires when user is updated by this plugin 51 - openid-connect-generic-update-user-using-current-claim - 2 args: fires every time an existing user logs in and the claims are updated. 52 - openid-connect-generic-redirect-user-back - 2 args: $redirect_url, $user. Allows interruption of redirect during login. 53 - openid-connect-generic-user-logged-in - 1 arg: $user, fires when user is logged in. 54 - openid-connect-generic-cron-daily - daily cron action 55 - openid-connect-generic-state-not-found - the given state does not exist in the database, regardless of its expiration. 56 - openid-connect-generic-state-expired - the given state exists, but expired before this login attempt. 57 58 Callable actions 55 59 56 60 User Meta … … 77 81 78 82 /** 83 * Singleton instance of self 84 * 85 * @var OpenID_Connect_Generic 86 */ 87 protected static $_instance = null; 88 89 /** 79 90 * Plugin version. 80 91 * 81 * @var 82 */ 83 const VERSION = '3. 8.5';92 * @var string 93 */ 94 const VERSION = '3.9.0'; 84 95 85 96 /** … … 109 120 * @var OpenID_Connect_Generic_Client_Wrapper 110 121 */ 111 p rivate$client_wrapper;122 public $client_wrapper; 112 123 113 124 /** … … 122 133 $this->settings = $settings; 123 134 $this->logger = $logger; 135 self::$_instance = $this; 124 136 } 125 137 … … 130 142 */ 131 143 public function init() { 132 133 wp_enqueue_style( 'daggerhart-openid-connect-generic-admin', plugin_dir_url( __FILE__ ) . 'css/styles-admin.css', array(), self::VERSION, 'all' );134 144 135 145 $redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); … … 152 162 $this->settings->endpoint_token, 153 163 $redirect_uri, 164 $this->settings->acr_values, 154 165 $state_time_limit, 155 166 $this->logger … … 328 339 array( 329 340 // OAuth client settings. 330 'login_type' => 'button',341 'login_type' => defined( 'OIDC_LOGIN_TYPE' ) ? OIDC_LOGIN_TYPE : 'button', 331 342 'client_id' => defined( 'OIDC_CLIENT_ID' ) ? OIDC_CLIENT_ID : '', 332 343 'client_secret' => defined( 'OIDC_CLIENT_SECRET' ) ? OIDC_CLIENT_SECRET : '', 333 'scope' => '',344 'scope' => defined( 'OIDC_CLIENT_SCOPE' ) ? OIDC_CLIENT_SCOPE : '', 334 345 'endpoint_login' => defined( 'OIDC_ENDPOINT_LOGIN_URL' ) ? OIDC_ENDPOINT_LOGIN_URL : '', 335 346 'endpoint_userinfo' => defined( 'OIDC_ENDPOINT_USERINFO_URL' ) ? OIDC_ENDPOINT_USERINFO_URL : '', 336 347 'endpoint_token' => defined( 'OIDC_ENDPOINT_TOKEN_URL' ) ? OIDC_ENDPOINT_TOKEN_URL : '', 337 348 'endpoint_end_session' => defined( 'OIDC_ENDPOINT_LOGOUT_URL' ) ? OIDC_ENDPOINT_LOGOUT_URL : '', 349 'acr_values' => defined( 'OIDC_ACR_VALUES' ) ? OIDC_ACR_VALUES : '', 338 350 339 351 // Non-standard settings. … … 347 359 348 360 // Plugin settings. 349 'enforce_privacy' => 0,361 'enforce_privacy' => defined( 'OIDC_ENFORCE_PRIVACY' ) ? intval( OIDC_ENFORCE_PRIVACY ) : 0, 350 362 'alternate_redirect_uri' => 0, 351 363 'token_refresh_enable' => 1, 352 'link_existing_users' => 0,353 'create_if_does_not_exist' => 1,354 'redirect_user_back' => 0,355 'redirect_on_logout' => 1,364 'link_existing_users' => defined( 'OIDC_LINK_EXISTING_USERS' ) ? intval( OIDC_LINK_EXISTING_USERS ) : 0, 365 'create_if_does_not_exist' => defined( 'OIDC_CREATE_IF_DOES_NOT_EXIST' ) ? intval( OIDC_CREATE_IF_DOES_NOT_EXIST ) : 1, 366 'redirect_user_back' => defined( 'OIDC_REDIRECT_USER_BACK' ) ? intval( OIDC_REDIRECT_USER_BACK ) : 0, 367 'redirect_on_logout' => defined( 'OIDC_REDIRECT_ON_LOGOUT' ) ? intval( OIDC_REDIRECT_ON_LOGOUT ) : 1, 356 368 'enable_logging' => 0, 357 369 'log_limit' => 1000, … … 371 383 add_filter( 'comment_text_rss', array( $plugin, 'enforce_privacy_feeds' ), 999 ); 372 384 } 385 386 /** 387 * Create (if needed) and return a singleton of self. 388 * 389 * @return OpenID_Connect_Generic 390 */ 391 public static function instance() { 392 if ( null === self::$_instance ) { 393 self::bootstrap(); 394 } 395 return self::$_instance; 396 } 373 397 } 374 398 375 OpenID_Connect_Generic:: bootstrap();399 OpenID_Connect_Generic::instance(); 376 400 377 401 register_activation_hook( __FILE__, array( 'OpenID_Connect_Generic', 'activation' ) ); 378 402 register_deactivation_hook( __FILE__, array( 'OpenID_Connect_Generic', 'deactivation' ) ); 403 404 // Provide publicly accessible plugin helper functions. 405 require_once( 'includes/functions.php' ); -
daggerhart-openid-connect-generic/tags/3.9.0/readme.txt
r2516022 r2698055 4 4 Tags: security, login, oauth2, openidconnect, apps, authentication, autologin, sso 5 5 Requires at least: 4.9 6 Tested up to: 5. 7.17 Stable tag: 3. 8.58 Requires PHP: 7. 16 Tested up to: 5.9.2 7 Stable tag: 3.9.0 8 Requires PHP: 7.2 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 3.8.5 55 56 * Fix: @timnolte - Fixes missing URL request validation before use & ensure proper current page URL is setup for Redirect Back. 57 * Fix: @timnolte - Fixes Redirect URL Logic to Handle Sub-directory Installs. 58 * Fix: @timnolte - Fixes to provide proper redirect user back for the openid_connect_generic_auth_url shortcode. 54 = 3.9.0 = 55 56 * Feature: @matchaxnb - Added support for additional configuration constants. 57 * Feature: @schanzen - Added support for agregated claims. 58 * Fix: @rkcreation - Fixed access token not updating user metadata after login. 59 * Fix: @danc1248 - Fixed user creation issue on Multisite Networks. 60 * Feature: @RobjS - Added plugin singleton to support for more developer customization. 61 * Feature: @jkouris - Added action hook to allow custom handling of session expiration. 62 * Fix: @tommcc - Fixed admin CSS loading only on the plugin settings screen. 63 * Feature: @rkcreation - Added method to refresh the user claim. 64 * Feature: @Glowsome - Added acr_values support & verification checks that it when defined in options is honored. 65 * Fix: @timnolte - Fixed regression which caused improper fallback on missing claims. 66 * Fix: @slykar - Fixed missing query string handling in redirect URL. 67 * Fix: @timnolte - Fixed issue with some user linking and user creation handling. 68 * Improvement: @timnolte - Fixed plugin settings typos and screen formatting. 69 * Security: @timnolte - Updated build tooling security vulnerabilities. 70 * Improvement: @timnolte - Changed build tooling scripts. 71 72 = 3.8.5 = 73 74 * Fix: @timnolte - Fixed missing URL request validation before use & ensure proper current page URL is setup for Redirect Back. 75 * Fix: @timnolte - Fixed Redirect URL Logic to Handle Sub-directory Installs. 76 * Fix: @timnolte - Fixed issue with redirecting user back when the openid_connect_generic_auth_url shortcode is used. 59 77 60 78 = 3.8.4 = -
daggerhart-openid-connect-generic/trunk/CHANGELOG.md
r2516022 r2698055 1 1 # OpenId Connect Generic Changelog 2 2 3 3.8.5 4 * Fix: @timnolte - Fixes missing URL request validation before use & ensure proper current page URL is setup for Redirect Back. 5 * Fix: @timnolte - Fixes Redirect URL Logic to Handle Sub-directory Installs. 6 * Fix: @timnolte - Fixes to provide proper redirect user back for the openid_connect_generic_auth_url shortcode. 3 3.9.0 7 4 8 3.8.4 9 * Fix: @timnolte - Fixed invalid State object access for redirection handling. 10 * Improvement: @timnolte - Fixed local wp-env Docker development environment. 11 * Improvement: @timnolte - Fixed Composer scripts for linting and static analysis. 5 - Feature: @matchaxnb - Added support for additional configuration constants. 6 - Feature: @schanzen - Added support for agregated claims. 7 - Fix: @rkcreation - Fixed access token not updating user metadata after login. 8 - Fix: @danc1248 - Fixed user creation issue on Multisite Networks. 9 - Feature: @RobjS - Added plugin singleton to support for more developer customization. 10 - Feature: @jkouris - Added action hook to allow custom handling of session expiration. 11 - Fix: @tommcc - Fixed admin CSS loading only on the plugin settings screen. 12 - Feature: @rkcreation - Added method to refresh the user claim. 13 - Feature: @Glowsome - Added acr_values support & verification checks that it when defined in options is honored. 14 - Fix: @timnolte - Fixed regression which caused improper fallback on missing claims. 15 - Fix: @slykar - Fixed missing query string handling in redirect URL. 16 - Fix: @timnolte - Fixed issue with some user linking and user creation handling. 17 - Improvement: @timnolte - Fixed plugin settings typos and screen formatting. 18 - Security: @timnolte - Updated build tooling security vulnerabilities. 19 - Improvement: @timnolte - Changed build tooling scripts. 12 20 13 3.8.3 21 3.8.5 14 22 15 * Fix: @timnolte - Fixed problems with proper redirect handling.16 * Improvement: @timnolte - Changes redirect handling to use State instead of cookies.17 * Improvement: @timnolte - Refactored additional code to meet coding standards.23 - Fix: @timnolte - Fixed missing URL request validation before use & ensure proper current page URL is setup for Redirect Back. 24 - Fix: @timnolte - Fixed Redirect URL Logic to Handle Sub-directory Installs. 25 - Fix: @timnolte - Fixed issue with redirecting user back when the openid_connect_generic_auth_url shortcode is used. 18 26 19 3.8.2 27 3.8.4 20 28 21 * Fix: @timnolte - Fixed reported XSS vulnerability on WordPress login screen. 29 - Fix: @timnolte - Fixed invalid State object access for redirection handling. 30 - Improvement: @timnolte - Fixed local wp-env Docker development environment. 31 - Improvement: @timnolte - Fixed Composer scripts for linting and static analysis. 22 32 23 3.8.1 33 3.8.3 24 34 25 * Fix: @timnolte - Prevent SSO redirect on password protected posts.26 * Fix: @timnolte - CI/CD build issues.27 * Fix: @timnolte - Invalid redirect handling on logout for Auto Login setting.35 - Fix: @timnolte - Fixed problems with proper redirect handling. 36 - Improvement: @timnolte - Changes redirect handling to use State instead of cookies. 37 - Improvement: @timnolte - Refactored additional code to meet coding standards. 28 38 29 3.8.0 39 3.8.2 30 40 31 * Feature: @timnolte - Ability to use 6 new constants for setting client configuration instead of storing in the DB. 32 * Improvement: @timnolte - NPM version requirements for development. 33 * Improvement: @timnolte - Travis CI build fixes. 34 * Improvement: @timnolte - GrumPHP configuration updates for code contributions. 35 * Improvement: @timnolte - Refactored to meet WordPress coding standards. 36 * Improvement: @timnolte - Refactored to provide localization. 37 * Improvement: @timnolte - Refactored to provide a Docker-based local development environment. 41 - Fix: @timnolte - Fixed reported XSS vulnerability on WordPress login screen. 38 42 39 3.7.143 3.8.1 40 44 41 * Fix: Release Version Number. 45 - Fix: @timnolte - Prevent SSO redirect on password protected posts. 46 - Fix: @timnolte - CI/CD build issues. 47 - Fix: @timnolte - Invalid redirect handling on logout for Auto Login setting. 42 48 43 3.7.049 3.8.0 44 50 45 * Feature: @timnolte - Ability to enable/disable token refresh. Useful for IDPs that don't support token refresh. 46 * Feature: @timnolte - Support custom redirect URL(`redirect_to`) with the authentication URL & login button shortcodes. 51 - Feature: @timnolte - Ability to use 6 new constants for setting client configuration instead of storing in the DB. 52 - Improvement: @timnolte - NPM version requirements for development. 53 - Improvement: @timnolte - Travis CI build fixes. 54 - Improvement: @timnolte - GrumPHP configuration updates for code contributions. 55 - Improvement: @timnolte - Refactored to meet WordPress coding standards. 56 - Improvement: @timnolte - Refactored to provide localization. 57 - Improvement: @timnolte - Refactored to provide a Docker-based local development environment. 58 59 3.7.1 60 61 - Fix: Release Version Number. 62 63 3.7.0 64 65 - Feature: @timnolte - Ability to enable/disable token refresh. Useful for IDPs that don't support token refresh. 66 - Feature: @timnolte - Support custom redirect URL(`redirect_to`) with the authentication URL & login button shortcodes. 67 47 68 - Supports additional attribute overrides including login `button_text`, `endpoint_login`, `scope`, `redirect_uri`. 48 69 49 3.6.070 3.6.0 50 71 51 *Improvement: @RobjS - Improved error messages during login state failure.52 *Improvement: @RobjS - New developer filter for login form button URL.53 *Fix: @cs1m0n - Only increment username during new user creation if the "Link existing user" setting is enabled.54 *Fix: @xRy-42 - Allow periods and spaces in usernames to match what WordPress core allows.55 *Feature: @benochen - New setting named "Create user if does not exist" determines whether new users are created during login attempts.56 *Improvement: @flat235 - Username transliteration and normalization.72 - Improvement: @RobjS - Improved error messages during login state failure. 73 - Improvement: @RobjS - New developer filter for login form button URL. 74 - Fix: @cs1m0n - Only increment username during new user creation if the "Link existing user" setting is enabled. 75 - Fix: @xRy-42 - Allow periods and spaces in usernames to match what WordPress core allows. 76 - Feature: @benochen - New setting named "Create user if does not exist" determines whether new users are created during login attempts. 77 - Improvement: @flat235 - Username transliteration and normalization. 57 78 58 3.5.179 3.5.1 59 80 60 *Fix: @daggerhart - New approach to state management using transients.81 - Fix: @daggerhart - New approach to state management using transients. 61 82 62 3.5.083 3.5.0 63 84 64 *Readme fix: @thijskh - Fix syntax error in example openid-connect-generic-login-button-text65 *Feature: @slavicd - Allow override of the plugin by posting credentials to wp-login.php66 *Feature: @gassan - New action on use login67 *Fix: @daggerhart - Avoid double question marks in auth url query string68 *Fix: @drzraf - wp-cli bootstrap must not inhibit custom rewrite rules69 *Syntax change: @mullikine - Change PHP keywords to comply with PSR285 - Readme fix: @thijskh - Fix syntax error in example openid-connect-generic-login-button-text 86 - Feature: @slavicd - Allow override of the plugin by posting credentials to wp-login.php 87 - Feature: @gassan - New action on use login 88 - Fix: @daggerhart - Avoid double question marks in auth url query string 89 - Fix: @drzraf - wp-cli bootstrap must not inhibit custom rewrite rules 90 - Syntax change: @mullikine - Change PHP keywords to comply with PSR2 70 91 71 92 **3.4.1** 72 93 73 *Minor documentation update and additional error checking.94 - Minor documentation update and additional error checking. 74 95 75 96 **3.4.0** 76 97 77 *Feature: @drzraf - New filter hook: ability to filter claim and derived user data before user creation.78 *Feature: @anttileppa - State time limit can now be changed on the settings page.79 *Fix: @drzraf - Fix PHP notice when using traditional login, $token_response may be empty.80 * Fix: @drzraf - Fixed a notice when cookie does not contain expected redirect_url 98 - Feature: @drzraf - New filter hook: ability to filter claim and derived user data before user creation. 99 - Feature: @anttileppa - State time limit can now be changed on the settings page. 100 - Fix: @drzraf - Fix PHP notice when using traditional login, $token_response may be empty. 101 - Fix: @drzraf - Fixed a notice when cookie does not contain expected redirect_url 81 102 82 103 **3.3.1** 83 104 84 *Prefixing classes for more efficient autoloading.85 *Avoid altering global wp_remote_post() parameters.86 *Minor metadata updates for wp.org105 - Prefixing classes for more efficient autoloading. 106 - Avoid altering global wp_remote_post() parameters. 107 - Minor metadata updates for wp.org 87 108 88 109 **3.3.0** 89 110 90 *Fix: @pjeby - Handle multiple user sessions better by using the `WP_Session_Tokens` object. Predecessor to fixes for multiple other issues: #49, #50, #51111 - Fix: @pjeby - Handle multiple user sessions better by using the `WP_Session_Tokens` object. Predecessor to fixes for multiple other issues: #49, #50, #51 91 112 92 113 **3.2.1** 93 114 94 *Bug fix: @svenvanhal - Exit after issuing redirect. Fixes #46115 - Bug fix: @svenvanhal - Exit after issuing redirect. Fixes #46 95 116 96 117 **3.2.0** 97 118 98 *Feature: @robbiepaul - trigger core action `wp_login` when user is logged in through this plugin99 *Feature: @moriyoshi - Determine the WP_User display name with replacement tokens on the settings page. Tokens can be any property of the user_claim.100 *Feature: New setting to set redirect URL when session expires.101 *Feature: @robbiepaul - New filter for modifying authentication URL102 *Fix: @cedrox - Adding id_token_hint to logout URL according to spec103 *Bug fix: Provide port to the request header when requesting the user_claim119 - Feature: @robbiepaul - trigger core action `wp_login` when user is logged in through this plugin 120 - Feature: @moriyoshi - Determine the WP_User display name with replacement tokens on the settings page. Tokens can be any property of the user_claim. 121 - Feature: New setting to set redirect URL when session expires. 122 - Feature: @robbiepaul - New filter for modifying authentication URL 123 - Fix: @cedrox - Adding id_token_hint to logout URL according to spec 124 - Bug fix: Provide port to the request header when requesting the user_claim 104 125 105 126 **3.1.0** 106 127 107 * Feature: @rwasef1830 - Refresh tokens 108 *Feature: @rwasef1830 - Integrated logout support with end_session endpoint109 *Feature: May use an alternate redirect_uri that doesn't rely on admin-ajax110 *Feature: @ahatherly - Support for IDP behind reverse proxy111 *Bug fix: @robertstaddon - case insensitive check for Bearer token112 *Bug fix: @rwasef1830 - "redirect to origin when auto-sso" cookie issue113 *Bug fix: @rwasef1830 - PHP Warnings headers already sent due to attempts to redirect and set cookies during login form message114 *Bug fix: @rwasef1830 - expire session when access_token expires if no refresh token found115 *UX fix: @rwasef1830 - Show login button on error redirect when using auto-sso128 - Feature: @rwasef1830 - Refresh tokens 129 - Feature: @rwasef1830 - Integrated logout support with end_session endpoint 130 - Feature: May use an alternate redirect_uri that doesn't rely on admin-ajax 131 - Feature: @ahatherly - Support for IDP behind reverse proxy 132 - Bug fix: @robertstaddon - case insensitive check for Bearer token 133 - Bug fix: @rwasef1830 - "redirect to origin when auto-sso" cookie issue 134 - Bug fix: @rwasef1830 - PHP Warnings headers already sent due to attempts to redirect and set cookies during login form message 135 - Bug fix: @rwasef1830 - expire session when access_token expires if no refresh token found 136 - UX fix: @rwasef1830 - Show login button on error redirect when using auto-sso 116 137 117 138 **3.0.8** 118 139 119 *Feature: @wgengarelly - Added `openid-connect-generic-update-user-using-current-claim` action hook allowing other plugins/themes140 - Feature: @wgengarelly - Added `openid-connect-generic-update-user-using-current-claim` action hook allowing other plugins/themes 120 141 to take action using the fresh claims received when an existing user logs in. 121 142 122 143 **3.0.7** 123 144 124 * Bug fix: @wgengarelly - When requesting userinfo, send the access token using the Authorization header field as recommended in 125 section 5.3.1 of the specs. 145 - Bug fix: @wgengarelly - When requesting userinfo, send the access token using the Authorization header field as recommended in 146 section 5.3.1 of the specs. 126 147 127 148 **3.0.6** 128 149 129 *Bug fix: @robertstaddon - If "Link Existing Users" is enabled, allow users who login with OpenID Connect to also log in with WordPress credentials150 - Bug fix: @robertstaddon - If "Link Existing Users" is enabled, allow users who login with OpenID Connect to also log in with WordPress credentials 130 151 131 152 **3.0.5** 132 153 133 *Feature: @robertstaddon - Added `[openid_connect_generic_login_button]` shortcode to allow the login button to be placed anywhere134 *Feature: @robertstaddon - Added setting to "Redirect Back to Origin Page" after a successful login instead of redirecting to the home page.154 - Feature: @robertstaddon - Added `[openid_connect_generic_login_button]` shortcode to allow the login button to be placed anywhere 155 - Feature: @robertstaddon - Added setting to "Redirect Back to Origin Page" after a successful login instead of redirecting to the home page. 135 156 136 157 **3.0.4** 137 158 138 *Feature: @robertstaddon - Added setting to allow linking existing WordPress user accounts with newly-authenticated OpenID Connect login159 - Feature: @robertstaddon - Added setting to allow linking existing WordPress user accounts with newly-authenticated OpenID Connect login 139 160 140 161 **3.0.3** 141 162 142 *Using WordPresss's is_ssl() for setcookie()'s "secure" parameter143 *Bug fix: Incrementing username in case of collision.144 *Bug fix: Wrong error sent when missing token body163 - Using WordPresss's is_ssl() for setcookie()'s "secure" parameter 164 - Bug fix: Incrementing username in case of collision. 165 - Bug fix: Wrong error sent when missing token body 145 166 146 167 **3.0.2** 147 168 148 *Added http_request_timeout setting169 - Added http_request_timeout setting 149 170 150 171 **3.0.1** 151 172 152 *Finalizing 3.0.x api173 - Finalizing 3.0.x api 153 174 154 175 **3.0** 155 176 156 *Complete rewrite to separate concerns157 *Changed settings keys for clarity (requires updating settings if upgrading from another version)158 *Error logging177 - Complete rewrite to separate concerns 178 - Changed settings keys for clarity (requires updating settings if upgrading from another version) 179 - Error logging 159 180 160 181 **2.1** 161 182 162 * Working my way closer to spec. Possible breaking change.Now checking for preferred_username as priority.163 *New username determination to avoid collisions183 - Working my way closer to spec. Possible breaking change. Now checking for preferred_username as priority. 184 - New username determination to avoid collisions 164 185 165 186 **2.0** 166 187 167 188 Complete rewrite 168 -
daggerhart-openid-connect-generic/trunk/includes/openid-connect-generic-client-wrapper.php
r2516022 r2698055 149 149 */ 150 150 public function get_redirect_to() { 151 // @var WP $wp WordPress environment setup class. 151 152 global $wp; 152 153 … … 171 172 if ( $this->settings->redirect_user_back ) { 172 173 if ( ! empty( $wp->request ) ) { 173 if ( ! empty( $wp->did_permalink ) && $wp->did_permalink) {174 $redirect_url = home_url( trailingslashit( $wp->request) );174 if ( ! empty( $wp->did_permalink ) && boolval( $wp->did_permalink ) === true ) { 175 $redirect_url = home_url( add_query_arg( $_GET, trailingslashit( $wp->request ) ) ); 175 176 } else { 176 177 $redirect_url = home_url( add_query_arg( null, null ) ); … … 211 212 'redirect_uri' => $this->client->get_redirect_uri(), 212 213 'redirect_to' => $this->get_redirect_to(), 214 'acr_values' => $this->settings->acr_values, 213 215 ), 214 216 $atts, … … 225 227 $separator = '&'; 226 228 } 229 230 $url_format = '%1$s%2$sresponse_type=code&scope=%3$s&client_id=%4$s&state=%5$s&redirect_uri=%6$s'; 231 if ( ! empty( $atts['acr_values'] ) ) { 232 $url_format .= '&acr_values=%7$s'; 233 } 234 227 235 $url = sprintf( 228 '%1$s%2$sresponse_type=code&scope=%3$s&client_id=%4$s&state=%5$s&redirect_uri=%6$s',236 $url_format, 229 237 $atts['endpoint_login'], 230 238 $separator, … … 232 240 rawurlencode( $atts['client_id'] ), 233 241 $this->client->new_state( $atts['redirect_to'] ), 234 rawurlencode( $atts['redirect_uri'] ) 242 rawurlencode( $atts['redirect_uri'] ), 243 rawurlencode( $atts['acr_values'] ) 235 244 ); 236 245 … … 272 281 273 282 if ( ! $refresh_token || ( $refresh_expires && $current_time > $refresh_expires ) ) { 274 wp_logout(); 275 276 if ( $this->settings->redirect_on_logout ) { 277 $this->error_redirect( new WP_Error( 'access-token-expired', __( 'Session expired. Please login again.', 'daggerhart-openid-connect-generic' ) ) ); 283 if ( isset( $_SERVER['REQUEST_URI'] ) ) { 284 do_action( 'openid-connect-generic-session-expired', wp_get_current_user(), esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); 285 wp_logout(); 286 287 if ( $this->settings->redirect_on_logout ) { 288 $this->error_redirect( new WP_Error( 'access-token-expired', __( 'Session expired. Please login again.', 'daggerhart-openid-connect-generic' ) ) ); 289 } 290 291 return; 278 292 } 279 280 return;281 293 } 282 294 … … 295 307 } 296 308 309 update_user_meta( $user_id, 'openid-connect-generic-last-token-response', $token_response ); 297 310 $this->save_refresh_token( $manager, $token, $token_response ); 298 311 } … … 511 524 $user = $this->get_user_by_identity( $subject_identity ); 512 525 526 // A pre-existing IDP mapped user wasn't found. 513 527 if ( ! $user ) { 514 if ( $this->settings->create_if_does_not_exist ) { 528 // If linking existing users or creating new ones call the `create_new_user` method which handles both cases. 529 if ( $this->settings->link_existing_users || $this->settings->create_if_does_not_exist ) { 515 530 $user = $this->create_new_user( $subject_identity, $user_claim ); 516 531 if ( is_wp_error( $user ) ) { … … 520 535 $this->error_redirect( new WP_Error( 'identity-not-map-existing-user', __( 'User identity is not linked to an existing WordPress user.', 'daggerhart-openid-connect-generic' ), $user_claim ) ); 521 536 } 522 } else {523 // Allow plugins / themes to take action using current claims on existing user (e.g. update role).524 do_action( 'openid-connect-generic-update-user-using-current-claim', $user, $user_claim );525 537 } 526 538 … … 535 547 $this->login_user( $user, $token_response, $id_token_claim, $user_claim, $subject_identity ); 536 548 549 // Allow plugins / themes to take action once a user is logged in. 537 550 do_action( 'openid-connect-generic-user-logged-in', $user ); 538 551 … … 581 594 582 595 /** 596 * Refresh user claim. 597 * 598 * @param WP_User $user The user object. 599 * @param array $token_response The token response. 600 * 601 * @return WP_Error|array 602 */ 603 public function refresh_user_claim( $user, $token_response ) { 604 $client = $this->client; 605 606 /** 607 * The id_token is used to identify the authenticated user, e.g. for SSO. 608 * The access_token must be used to prove access rights to protected 609 * resources e.g. for the userinfo endpoint 610 */ 611 $id_token_claim = $client->get_id_token_claim( $token_response ); 612 613 // Allow for other plugins to alter data before validation. 614 $id_token_claim = apply_filters( 'openid-connect-modify-id-token-claim-before-validation', $id_token_claim ); 615 616 if ( is_wp_error( $id_token_claim ) ) { 617 return $id_token_claim; 618 } 619 620 // Validate our id_token has required values. 621 $valid = $client->validate_id_token_claim( $id_token_claim ); 622 623 if ( is_wp_error( $valid ) ) { 624 return $valid; 625 } 626 627 // If userinfo endpoint is set, exchange the token_response for a user_claim. 628 if ( ! empty( $this->settings->endpoint_userinfo ) && isset( $token_response['access_token'] ) ) { 629 $user_claim = $client->get_user_claim( $token_response ); 630 } else { 631 $user_claim = $id_token_claim; 632 } 633 634 if ( is_wp_error( $user_claim ) ) { 635 return $user_claim; 636 } 637 638 // Validate our user_claim has required values. 639 $valid = $client->validate_user_claim( $user_claim, $id_token_claim ); 640 641 if ( is_wp_error( $valid ) ) { 642 $this->error_redirect( $valid ); 643 return $valid; 644 } 645 646 // Store the tokens for future reference. 647 update_user_meta( $user->ID, 'openid-connect-generic-last-token-response', $token_response ); 648 update_user_meta( $user->ID, 'openid-connect-generic-last-id-token-claim', $id_token_claim ); 649 update_user_meta( $user->ID, 'openid-connect-generic-last-user-claim', $user_claim ); 650 651 return $user_claim; 652 } 653 654 /** 583 655 * Record user meta data, and provide an authorization cookie. 584 656 * … … 596 668 update_user_meta( $user->ID, 'openid-connect-generic-last-id-token-claim', $id_token_claim ); 597 669 update_user_meta( $user->ID, 'openid-connect-generic-last-user-claim', $user_claim ); 670 // Allow plugins / themes to take action using current claims on existing user (e.g. update role). 671 do_action( 'openid-connect-generic-update-user-using-current-claim', $user, $user_claim ); 598 672 599 673 // Create the WP session, so we know its token. … … 657 731 ), 658 732 ), 733 // Override the default blog_id (get_current_blog_id) to find users on different sites of a multisite install. 734 'blog_id' => 0, 659 735 ) 660 736 ); 661 737 662 // If we found anexisting users, grab the first one returned.738 // If we found existing users, grab the first one returned. 663 739 if ( $user_query->get_total() > 0 ) { 664 740 $users = $user_query->get_results(); … … 674 750 * @param array $user_claim The IDP authenticated user claim data. 675 751 * 676 * @return string|WP_Error |null752 * @return string|WP_Error 677 753 */ 678 754 private function get_username_from_claim( $user_claim ) { … … 684 760 if ( ! empty( $this->settings->identity_key ) && isset( $user_claim[ $this->settings->identity_key ] ) ) { 685 761 $desired_username = $user_claim[ $this->settings->identity_key ]; 686 } else if ( isset( $user_claim['preferred_username'] ) && ! empty( $user_claim['preferred_username'] ) ) { 762 } 763 if ( empty( $desired_username ) && isset( $user_claim['preferred_username'] ) && ! empty( $user_claim['preferred_username'] ) ) { 687 764 $desired_username = $user_claim['preferred_username']; 688 } else if ( isset( $user_claim['name'] ) && ! empty( $user_claim['name'] ) ) { 765 } 766 if ( empty( $desired_username ) && isset( $user_claim['name'] ) && ! empty( $user_claim['name'] ) ) { 689 767 $desired_username = $user_claim['name']; 690 } else if ( isset( $user_claim['email'] ) && ! empty( $user_claim['email'] ) ) { 768 } 769 if ( empty( $desired_username ) && isset( $user_claim['email'] ) && ! empty( $user_claim['email'] ) ) { 691 770 $tmp = explode( '@', $user_claim['email'] ); 692 771 $desired_username = $tmp[0]; 693 } else { 772 } 773 if ( empty( $desired_username ) ) { 694 774 // Nothing to build a name from. 695 775 return new WP_Error( 'no-username', __( 'No appropriate username found.', 'daggerhart-openid-connect-generic' ), $user_claim ); 696 776 } 697 777 698 // Normalize the data a bit. 699 // @var string $transliterated_username The username converted to ASCII from UTF-8. 700 $transliterated_username = iconv( 'UTF-8', 'ASCII//TRANSLIT', $desired_username ); 701 if ( empty( $transliterated_username ) ) { 702 // translators: $1$s is a username from the IDP. 703 return new WP_Error( 'username-transliteration-failed', sprintf( __( 'Username %1$s could not be transliterated.', 'daggerhart-openid-connect-generic' ), $desired_username ), $desired_username ); 704 } 705 $normalized_username = strtolower( preg_replace( '/[^a-zA-Z0-9 _.\-@]/', '', $transliterated_username ) ); 706 if ( empty( $normalized_username ) ) { 707 // translators: %1$s is the ASCII version of the username from the IDP. 708 return new WP_Error( 'username-normalization-failed', sprintf( __( 'Username %1$s could not be normalized.', 'daggerhart-openid-connect-generic' ), $transliterated_username ), $transliterated_username ); 709 } 710 711 // Copy the username for incrementing. 712 $username = ! empty( $normalized_username ) ? $normalized_username : null; 713 714 if ( ! $this->settings->link_existing_users && ! is_null( $username ) ) { 715 // @example Original user gets "name", second user gets "name2", etc. 716 $count = 1; 717 while ( username_exists( $username ) ) { 718 $count ++; 719 $username = $normalized_username . $count; 720 } 721 } 722 723 return $username; 778 // Don't use the full email address for a username. 779 $_desired_username = explode( '@', $desired_username ); 780 $desired_username = $_desired_username[0]; 781 // Use WordPress Core to sanitize the IDP username. 782 $sanitized_username = sanitize_user( $desired_username, true ); 783 if ( empty( $sanitized_username ) ) { 784 // translators: %1$s is the santitized version of the username from the IDP. 785 return new WP_Error( 'username-sanitization-failed', sprintf( __( 'Username %1$s could not be sanitized.', 'daggerhart-openid-connect-generic' ), $desired_username ), $desired_username ); 786 } 787 788 return $sanitized_username; 724 789 } 725 790 … … 747 812 748 813 /** 814 * Checks if $claimname is in the body or _claim_names of the userinfo. 815 * If yes, returns the claim value. Otherwise, returns false. 816 * 817 * @param string $claimname the claim name to look for. 818 * @param array $userinfo the JSON to look in. 819 * @param string $claimvalue the source claim value ( from the body of the JWT of the claim source). 820 * @return true|false 821 */ 822 private function get_claim( $claimname, $userinfo, &$claimvalue ) { 823 /** 824 * If we find a simple claim, return it. 825 */ 826 if ( array_key_exists( $claimname, $userinfo ) ) { 827 $claimvalue = $userinfo[ $claimname ]; 828 return true; 829 } 830 /** 831 * If there are no aggregated claims, it is over. 832 */ 833 if ( ! array_key_exists( '_claim_names', $userinfo ) || 834 ! array_key_exists( '_claim_sources', $userinfo ) ) { 835 return false; 836 } 837 $claim_src_ptr = $userinfo['_claim_names']; 838 if ( ! isset( $claim_src_ptr ) ) { 839 return false; 840 } 841 /** 842 * No reference found 843 */ 844 if ( ! array_key_exists( $claimname, $claim_src_ptr ) ) { 845 return false; 846 } 847 $src_name = $claim_src_ptr[ $claimname ]; 848 // Reference found, but no corresponding JWT. This is a malformed userinfo. 849 if ( ! array_key_exists( $src_name, $userinfo['_claim_sources'] ) ) { 850 return false; 851 } 852 $src = $userinfo['_claim_sources'][ $src_name ]; 853 // Source claim is not a JWT. Abort. 854 if ( ! array_key_exists( 'JWT', $src ) ) { 855 return false; 856 } 857 /** 858 * Extract claim from JWT. 859 * FIXME: We probably want to verify the JWT signature/issuer here. 860 * For example, using JWKS if applicable. For symmetrically signed 861 * JWTs (HMAC), we need a way to specify the acceptable secrets 862 * and each possible issuer in the config. 863 */ 864 $jwt = $src['JWT']; 865 list ( $header, $body, $rest ) = explode( '.', $jwt, 3 ); 866 $body_str = base64_decode( $body, false ); 867 if ( ! $body_str ) { 868 return false; 869 } 870 $body_json = json_decode( $body_str, true ); 871 if ( ! isset( $body_json ) ) { 872 return false; 873 } 874 if ( ! array_key_exists( $claimname, $body_json ) ) { 875 return false; 876 } 877 $claimvalue = $body_json[ $claimname ]; 878 return true; 879 } 880 881 882 /** 749 883 * Build a string from the user claim according to the specified format. 750 884 * … … 758 892 $matches = null; 759 893 $string = ''; 894 $info = ''; 760 895 $i = 0; 761 896 if ( preg_match_all( '/\{[^}]*\}/u', $format, $matches, PREG_OFFSET_CAPTURE ) ) { … … 763 898 $key = substr( $match[0], 1, -1 ); 764 899 $string .= substr( $format, $i, $match[1] - $i ); 765 if ( ! isset( $user_claim[ $key ]) ) {900 if ( ! $this->get_claim( $key, $user_claim, $info ) ) { 766 901 if ( $error_on_missing_key ) { 767 902 return new WP_Error( … … 777 912 } 778 913 } else { 779 $string .= $ user_claim[ $key ];914 $string .= $info; 780 915 } 781 916 $i = $match[1] + strlen( $match[0] ); … … 836 971 // Allow claim details to determine username, email, nickname and displayname. 837 972 $_email = $this->get_email_from_claim( $user_claim, true ); 838 if ( is_wp_error( $_email ) ) {973 if ( is_wp_error( $_email ) || empty( $_email ) ) { 839 974 $values_missing = true; 840 } else if ( ! is_null( $_email ) ){975 } else { 841 976 $email = $_email; 842 977 } 843 978 844 979 $_username = $this->get_username_from_claim( $user_claim ); 845 if ( is_wp_error( $_username ) ) {980 if ( is_wp_error( $_username ) || empty( $_username ) ) { 846 981 $values_missing = true; 847 } else if ( ! is_null( $_username ) ){982 } else { 848 983 $username = $_username; 849 984 } 850 985 851 986 $_nickname = $this->get_nickname_from_claim( $user_claim ); 852 if ( is_ null( $_nickname ) ) {987 if ( is_wp_error( $_nickname ) || empty( $_nickname ) ) { 853 988 $values_missing = true; 854 989 } else { … … 857 992 858 993 $_displayname = $this->get_displayname_from_claim( $user_claim, true ); 859 if ( is_wp_error( $_displayname ) ) {994 if ( is_wp_error( $_displayname ) || empty( $_displayname ) ) { 860 995 $values_missing = true; 861 } else if ( ! is_null( $_displayname ) ){996 } else { 862 997 $displayname = $_displayname; 863 998 } … … 878 1013 if ( is_wp_error( $_email ) ) { 879 1014 return $_email; 880 } else if ( ! is_null( $_email ) ) { 1015 } 1016 // Use the email address from the latest userinfo request if not empty. 1017 if ( ! empty( $_email ) ) { 881 1018 $email = $_email; 882 1019 } … … 885 1022 if ( is_wp_error( $_username ) ) { 886 1023 return $_username; 887 } else if ( ! is_null( $_username ) ) { 1024 } 1025 // Use the username from the latest userinfo request if not empty. 1026 if ( ! empty( $_username ) ) { 888 1027 $username = $_username; 889 1028 } … … 892 1031 if ( is_wp_error( $_nickname ) ) { 893 1032 return $_nickname; 894 } else if ( is_null( $_nickname ) ) { 1033 } 1034 // Use the username as the nickname if the userinfo request nickname is empty. 1035 if ( empty( $_nickname ) ) { 895 1036 $nickname = $username; 896 1037 } … … 899 1040 if ( is_wp_error( $_displayname ) ) { 900 1041 return $_displayname; 901 } else if ( is_null( $_displayname ) ) { 1042 } 1043 // Use the nickname as the displayname if the userinfo request displayname is empty. 1044 if ( empty( $_displayname ) ) { 902 1045 $displayname = $nickname; 903 1046 } 904 1047 905 // Before trying to create the user, first check if a user with the same email alreadyexists.1048 // Before trying to create the user, first check if a matching user exists. 906 1049 if ( $this->settings->link_existing_users ) { 1050 $uid = null; 907 1051 if ( $this->settings->identify_with_username ) { 908 1052 $uid = username_exists( $username ); … … 910 1054 $uid = email_exists( $email ); 911 1055 } 912 if ( $uid) {1056 if ( ! empty( $uid ) ) { 913 1057 $user = $this->update_existing_user( $uid, $subject_identity ); 914 1058 do_action( 'openid-connect-generic-update-user-using-current-claim', $user, $user_claim ); … … 921 1065 * based on the returned user claim. 922 1066 */ 923 $create_user = apply_filters( 'openid-connect-generic-user-creation-test', true, $user_claim );1067 $create_user = apply_filters( 'openid-connect-generic-user-creation-test', $this->settings->create_if_does_not_exist, $user_claim ); 924 1068 925 1069 if ( ! $create_user ) { 926 1070 return new WP_Error( 'cannot-authorize', __( 'Can not authorize.', 'daggerhart-openid-connect-generic' ), $create_user ); 1071 } 1072 1073 // Copy the username for incrementing. 1074 $_username = $username; 1075 // Ensure prevention of linking usernames & collisions by incrementing the username if it exists. 1076 // @example Original user gets "name", second user gets "name2", etc. 1077 $count = 1; 1078 while ( username_exists( $username ) ) { 1079 $count ++; 1080 $username = $_username . $count; 927 1081 } 928 1082 -
daggerhart-openid-connect-generic/trunk/includes/openid-connect-generic-client.php
r2516022 r2698055 84 84 85 85 /** 86 * The specifically requested authentication contract at the IDP 87 * 88 * @see OpenID_Connect_Generic_Option_Settings::acr_values 89 * 90 * @var string 91 */ 92 private $acr_values; 93 94 /** 86 95 * The state time limit. States are only valid for 3 minutes. 87 96 * … … 109 118 * @param string $endpoint_token @see OpenID_Connect_Generic_Option_Settings::endpoint_token for description. 110 119 * @param string $redirect_uri @see OpenID_Connect_Generic_Option_Settings::redirect_uri for description. 120 * @param string $acr_values @see OpenID_Connect_Generic_Option_Settings::acr_values for description. 111 121 * @param int $state_time_limit @see OpenID_Connect_Generic_Option_Settings::state_time_limit for description. 112 122 * @param OpenID_Connect_Generic_Option_Logger $logger The plugin logging object instance. 113 123 */ 114 public function __construct( $client_id, $client_secret, $scope, $endpoint_login, $endpoint_userinfo, $endpoint_token, $redirect_uri, $ state_time_limit, $logger ) {124 public function __construct( $client_id, $client_secret, $scope, $endpoint_login, $endpoint_userinfo, $endpoint_token, $redirect_uri, $acr_values, $state_time_limit, $logger ) { 115 125 $this->client_id = $client_id; 116 126 $this->client_secret = $client_secret; … … 120 130 $this->endpoint_token = $endpoint_token; 121 131 $this->redirect_uri = $redirect_uri; 132 $this->acr_values = $acr_values; 122 133 $this->state_time_limit = $state_time_limit; 123 134 $this->logger = $logger; … … 213 224 ); 214 225 226 if ( ! empty( $this->acr_values ) ) { 227 $request['body'] += array( 'acr_values' => $this->acr_values ); 228 } 229 215 230 // Allow modifications to the request. 216 231 $request = apply_filters( 'openid-connect-generic-alter-request', $request, 'get-authentication-token' ); … … 465 480 } 466 481 482 // Validate acr values when the option is set in the configuration. 483 if ( ! empty( $this->acr_values ) && isset( $id_token_claim['acr'] ) ) { 484 if ( $this->acr_values != $id_token_claim['acr'] ) { 485 return new WP_Error( 'no-match-acr', __( 'No matching acr values.', 'daggerhart-openid-connect-generic' ), $id_token_claim ); 486 } 487 } 488 467 489 return true; 468 490 } -
daggerhart-openid-connect-generic/trunk/includes/openid-connect-generic-option-settings.php
r2511857 r2698055 34 34 * @property string $endpoint_token The IDP token validation endpoint URL. 35 35 * @property string $endpoint_end_session The IDP logout endpoint URL. 36 * @property string $acr_values The Authentication contract as defined on the IDP. 36 37 * 37 38 * Non-standard Settings: … … 87 88 */ 88 89 private $environment_settings = array( 89 'client_id' => 'OIDC_CLIENT_ID', 90 'client_secret' => 'OIDC_CLIENT_SECRET', 91 'endpoint_login' => 'OIDC_ENDPOINT_LOGIN_URL', 92 'endpoint_userinfo' => 'OIDC_ENDPOINT_USERINFO_URL', 93 'endpoint_token' => 'OIDC_ENDPOINT_TOKEN_URL', 94 'endpoint_end_session' => 'OIDC_ENDPOINT_LOGOUT_URL', 90 'client_id' => 'OIDC_CLIENT_ID', 91 'client_secret' => 'OIDC_CLIENT_SECRET', 92 'endpoint_end_session' => 'OIDC_ENDPOINT_LOGOUT_URL', 93 'endpoint_login' => 'OIDC_ENDPOINT_LOGIN_URL', 94 'endpoint_token' => 'OIDC_ENDPOINT_TOKEN_URL', 95 'endpoint_userinfo' => 'OIDC_ENDPOINT_USERINFO_URL', 96 'login_type' => 'OIDC_LOGIN_TYPE', 97 'scope' => 'OIDC_CLIENT_SCOPE', 98 'create_if_does_not_exist' => 'OIDC_CREATE_IF_DOES_NOT_EXIST', 99 'enforce_privacy' => 'OIDC_ENFORCE_PRIVACY', 100 'link_existing_users' => 'OIDC_LINK_EXISTING_USERS', 101 'redirect_on_logout' => 'OIDC_REDIRECT_ON_LOGOUT', 102 'redirect_user_back' => 'OIDC_REDIRECT_USER_BACK', 103 'acr_values' => 'OIDC_ACR_VALUES', 95 104 ); 96 105 -
daggerhart-openid-connect-generic/trunk/includes/openid-connect-generic-settings-page.php
r2511857 r2698055 217 217 'auto' => __( 'Auto Login - SSO', 'daggerhart-openid-connect-generic' ), 218 218 ), 219 'disabled' => defined( 'OIDC_LOGIN_TYPE' ), 219 220 'section' => 'client_settings', 220 221 ), … … 239 240 'example' => 'email profile openid offline_access', 240 241 'type' => 'text', 242 'disabled' => defined( 'OIDC_CLIENT_SCOPE' ), 241 243 'section' => 'client_settings', 242 244 ), … … 273 275 'section' => 'client_settings', 274 276 ), 277 'acr_values' => array( 278 'title' => __( 'ACR values', 'daggerhart-openid-connect-generic' ), 279 'description' => __( 'Use a specific defined authentication contract from the IDP - optional.', 'daggerhart-openid-connect-generic' ), 280 'type' => 'text', 281 'disabled' => defined( 'OIDC_ACR_VALUES' ), 282 'section' => 'client_settings', 283 ), 275 284 'identity_key' => array( 276 285 'title' => __( 'Identity Key', 'daggerhart-openid-connect-generic' ), … … 298 307 'description' => __( 'Require users be logged in to see the site.', 'daggerhart-openid-connect-generic' ), 299 308 'type' => 'checkbox', 309 'disabled' => defined( 'OIDC_ENFORCE_PRIVACY' ), 300 310 'section' => 'authorization_settings', 301 311 ), … … 349 359 'description' => __( 'If a WordPress account already exists with the same identity as a newly-authenticated user over OpenID Connect, login as that user instead of generating an error.', 'daggerhart-openid-connect-generic' ), 350 360 'type' => 'checkbox', 361 'disabled' => defined( 'OIDC_LINK_EXISTING_USERS' ), 351 362 'section' => 'user_settings', 352 363 ), 353 364 'create_if_does_not_exist' => array( 354 365 'title' => __( 'Create user if does not exist', 'daggerhart-openid-connect-generic' ), 355 'description' => __( 'If the user identity is not link to an existing Wordpress user, it is created. If this setting is not enabled and if the user authenticates with an account which is not link to an existing Wordpress user then the authentication failed', 'daggerhart-openid-connect-generic' ), 356 'type' => 'checkbox', 366 'description' => __( 'If the user identity is not linked to an existing WordPress user, it is created. If this setting is not enabled, and if the user authenticates with an account which is not linked to an existing WordPress user, then the authentication will fail.', 'daggerhart-openid-connect-generic' ), 367 'type' => 'checkbox', 368 'disabled' => defined( 'OIDC_CREATE_IF_DOES_NOT_EXIST' ), 357 369 'section' => 'user_settings', 358 370 ), … … 361 373 'description' => __( 'After a successful OpenID Connect authentication, this will redirect the user back to the page on which they clicked the OpenID Connect login button. This will cause the login process to proceed in a traditional WordPress fashion. For example, users logging in through the default wp-login.php page would end up on the WordPress Dashboard and users logging in through the WooCommerce "My Account" page would end up on their account page.', 'daggerhart-openid-connect-generic' ), 362 374 'type' => 'checkbox', 375 'disabled' => defined( 'OIDC_REDIRECT_USER_BACK' ), 363 376 'section' => 'user_settings', 364 377 ), … … 367 380 'description' => __( 'When enabled, this will automatically redirect the user back to the WordPress login page if their access token has expired.', 'daggerhart-openid-connect-generic' ), 368 381 'type' => 'checkbox', 382 'disabled' => defined( 'OIDC_REDIRECT_ON_LOGOUT' ), 369 383 'section' => 'user_settings', 370 384 ), … … 415 429 */ 416 430 public function settings_page() { 431 wp_enqueue_style( 'daggerhart-openid-connect-generic-admin', plugin_dir_url( __DIR__ ) . 'css/styles-admin.css', array(), OpenID_Connect_Generic::VERSION, 'all' ); 432 417 433 $redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); 418 434 … … 473 489 ?> 474 490 <input type="<?php print esc_attr( $field['type'] ); ?>" 475 <?php echo ( ! empty( $field['disabled'] ) && boolval( $field['disabled'] ) ) ? ' disabled' : ''; ?>491 <?php echo ( ! empty( $field['disabled'] ) && boolval( $field['disabled'] ) === true ) ? ' disabled' : ''; ?> 476 492 id="<?php print esc_attr( $field['key'] ); ?>" 477 class="large-text<?php echo ( ! empty( $field['disabled'] ) && boolval( $field['disabled'] ) ) ? ' disabled' : ''; ?>"493 class="large-text<?php echo ( ! empty( $field['disabled'] ) && boolval( $field['disabled'] ) === true ) ? ' disabled' : ''; ?>" 478 494 name="<?php print esc_attr( $field['name'] ); ?>" 479 495 value="<?php print esc_attr( $this->settings->{ $field['key'] } ); ?>"> … … 531 547 ?> 532 548 <p class="description"> 533 <?php print esc_html( $field['description'] ); ?>549 <?php print wp_kses_post( $field['description'] ); ?> 534 550 <?php if ( isset( $field['example'] ) ) : ?> 535 551 <br/><strong><?php esc_html_e( 'Example', 'daggerhart-openid-connect-generic' ); ?>: </strong> -
daggerhart-openid-connect-generic/trunk/languages/openid-connect-generic.pot
r2516022 r2698055 1 # Copyright (C) 202 1daggerhart1 # Copyright (C) 2022 daggerhart 2 2 # This file is distributed under the GPL-2.0+. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: OpenID Connect Generic 3. 8.5\n"5 "Project-Id-Version: OpenID Connect Generic 3.9.0\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://github.com/daggerhart/openid-connect-generic/issues\n" 8 "POT-Creation-Date: 202 1-04-16 03:38:39+00:00\n"8 "POT-Creation-Date: 2022-03-22 03:28:37+00:00\n" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=utf-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "PO-Revision-Date: 202 1-MO-DA HO:MI+ZONE\n"12 "PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 14 "Language-Team: LANGUAGE <LL@li.org>\n" … … 26 26 "X-Generator: grunt-wp-i18n 1.0.3\n" 27 27 28 #: includes/openid-connect-generic-client-wrapper.php:2 7728 #: includes/openid-connect-generic-client-wrapper.php:288 29 29 msgid "Session expired. Please login again." 30 30 msgstr "" 31 31 32 #: includes/openid-connect-generic-client-wrapper.php:5 2032 #: includes/openid-connect-generic-client-wrapper.php:535 33 33 msgid "User identity is not linked to an existing WordPress user." 34 34 msgstr "" 35 35 36 #: includes/openid-connect-generic-client-wrapper.php:5 7636 #: includes/openid-connect-generic-client-wrapper.php:589 37 37 msgid "Invalid user." 38 38 msgstr "" 39 39 40 #: includes/openid-connect-generic-client-wrapper.php: 69540 #: includes/openid-connect-generic-client-wrapper.php:775 41 41 msgid "No appropriate username found." 42 42 msgstr "" 43 43 44 #: includes/openid-connect-generic-client-wrapper.php:703 45 #. translators: $1$s is a username from the IDP. 46 msgid "Username %1$s could not be transliterated." 47 msgstr "" 48 49 #: includes/openid-connect-generic-client-wrapper.php:708 50 #. translators: %1$s is the ASCII version of the username from the IDP. 51 msgid "Username %1$s could not be normalized." 52 msgstr "" 53 54 #: includes/openid-connect-generic-client-wrapper.php:742 44 #: includes/openid-connect-generic-client-wrapper.php:785 45 #. translators: %1$s is the santitized version of the username from the IDP. 46 msgid "Username %1$s could not be sanitized." 47 msgstr "" 48 49 #: includes/openid-connect-generic-client-wrapper.php:807 55 50 #. translators: %1$s is the configured User Claim nickname key. 56 51 msgid "No nickname found in user claim using key: %1$s." 57 52 msgstr "" 58 53 59 #: includes/openid-connect-generic-client-wrapper.php: 76954 #: includes/openid-connect-generic-client-wrapper.php:904 60 55 msgid "User claim incomplete." 61 56 msgstr "" 62 57 63 #: includes/openid-connect-generic-client-wrapper.php: 87158 #: includes/openid-connect-generic-client-wrapper.php:1006 64 59 msgid "Bad user claim result." 65 60 msgstr "" 66 61 67 #: includes/openid-connect-generic-client-wrapper.php: 92662 #: includes/openid-connect-generic-client-wrapper.php:1070 68 63 msgid "Can not authorize." 69 64 msgstr "" 70 65 71 #: includes/openid-connect-generic-client-wrapper.php: 94566 #: includes/openid-connect-generic-client-wrapper.php:1099 72 67 msgid "Failed user creation." 73 68 msgstr "" 74 69 75 #: includes/openid-connect-generic-client.php:1 6570 #: includes/openid-connect-generic-client.php:176 76 71 msgid "Missing state." 77 72 msgstr "" 78 73 79 #: includes/openid-connect-generic-client.php:1 6974 #: includes/openid-connect-generic-client.php:180 80 75 msgid "Invalid state." 81 76 msgstr "" 82 77 83 #: includes/openid-connect-generic-client.php:1 8478 #: includes/openid-connect-generic-client.php:195 84 79 msgid "Missing authentication code." 85 80 msgstr "" 86 81 87 #: includes/openid-connect-generic-client.php:2 2382 #: includes/openid-connect-generic-client.php:238 88 83 msgid "Request for authentication token failed." 89 84 msgstr "" 90 85 91 #: includes/openid-connect-generic-client.php:2 5486 #: includes/openid-connect-generic-client.php:269 92 87 msgid "Refresh token failed." 93 88 msgstr "" 94 89 95 #: includes/openid-connect-generic-client.php:2 6990 #: includes/openid-connect-generic-client.php:284 96 91 msgid "Missing token body." 97 92 msgstr "" 98 93 99 #: includes/openid-connect-generic-client.php:2 7794 #: includes/openid-connect-generic-client.php:292 100 95 msgid "Invalid token." 101 96 msgstr "" 102 97 103 #: includes/openid-connect-generic-client.php:3 2898 #: includes/openid-connect-generic-client.php:343 104 99 msgid "Request for userinfo failed." 105 100 msgstr "" 106 101 107 #: includes/openid-connect-generic-client.php: 388102 #: includes/openid-connect-generic-client.php:403 108 103 msgid "Missing authentication state." 109 104 msgstr "" 110 105 111 #: includes/openid-connect-generic-client.php:4 25106 #: includes/openid-connect-generic-client.php:440 112 107 msgid "No identity token." 113 108 msgstr "" 114 109 115 #: includes/openid-connect-generic-client.php:4 32110 #: includes/openid-connect-generic-client.php:447 116 111 msgid "Missing identity token." 117 112 msgstr "" 118 113 119 #: includes/openid-connect-generic-client.php:4 59114 #: includes/openid-connect-generic-client.php:474 120 115 msgid "Bad ID token claim." 121 116 msgstr "" 122 117 123 #: includes/openid-connect-generic-client.php:4 64118 #: includes/openid-connect-generic-client.php:479 124 119 msgid "No subject identity." 125 120 msgstr "" 126 121 127 #: includes/openid-connect-generic-client.php:483 122 #: includes/openid-connect-generic-client.php:485 123 msgid "No matching acr values." 124 msgstr "" 125 126 #: includes/openid-connect-generic-client.php:505 128 127 msgid "Bad user claim." 129 128 msgstr "" 130 129 131 #: includes/openid-connect-generic-client.php:5 03130 #: includes/openid-connect-generic-client.php:525 132 131 msgid "Invalid user claim." 133 132 msgstr "" 134 133 135 #: includes/openid-connect-generic-client.php:5 08134 #: includes/openid-connect-generic-client.php:530 136 135 msgid "Error from the IDP." 137 136 msgstr "" 138 137 139 #: includes/openid-connect-generic-client.php:5 17138 #: includes/openid-connect-generic-client.php:539 140 139 msgid "Incorrect user claim." 141 140 msgstr "" 142 141 143 #: includes/openid-connect-generic-client.php:5 24142 #: includes/openid-connect-generic-client.php:546 144 143 msgid "Unauthorized access." 145 144 msgstr "" … … 210 209 msgstr "" 211 210 212 #: includes/openid-connect-generic-settings-page.php:22 2211 #: includes/openid-connect-generic-settings-page.php:223 213 212 msgid "Client ID" 214 213 msgstr "" 215 214 216 #: includes/openid-connect-generic-settings-page.php:22 3215 #: includes/openid-connect-generic-settings-page.php:224 217 216 msgid "" 218 217 "The ID this client will be recognized as when connecting the to Identity " … … 220 219 msgstr "" 221 220 222 #: includes/openid-connect-generic-settings-page.php:23 0221 #: includes/openid-connect-generic-settings-page.php:231 223 222 msgid "Client Secret Key" 224 223 msgstr "" 225 224 226 #: includes/openid-connect-generic-settings-page.php:23 1225 #: includes/openid-connect-generic-settings-page.php:232 227 226 msgid "" 228 227 "Arbitrary secret key the server expects from this client. Can be anything, " … … 230 229 msgstr "" 231 230 232 #: includes/openid-connect-generic-settings-page.php:23 7231 #: includes/openid-connect-generic-settings-page.php:238 233 232 msgid "OpenID Scope" 234 233 msgstr "" 235 234 236 #: includes/openid-connect-generic-settings-page.php:23 8235 #: includes/openid-connect-generic-settings-page.php:239 237 236 msgid "Space separated list of scopes this client should access." 238 237 msgstr "" 239 238 240 #: includes/openid-connect-generic-settings-page.php:24 4239 #: includes/openid-connect-generic-settings-page.php:246 241 240 msgid "Login Endpoint URL" 242 241 msgstr "" 243 242 244 #: includes/openid-connect-generic-settings-page.php:24 5243 #: includes/openid-connect-generic-settings-page.php:247 245 244 msgid "Identify provider authorization endpoint." 246 245 msgstr "" 247 246 248 #: includes/openid-connect-generic-settings-page.php:25 2247 #: includes/openid-connect-generic-settings-page.php:254 249 248 msgid "Userinfo Endpoint URL" 250 249 msgstr "" 251 250 252 #: includes/openid-connect-generic-settings-page.php:25 3251 #: includes/openid-connect-generic-settings-page.php:255 253 252 msgid "Identify provider User information endpoint." 254 253 msgstr "" 255 254 256 #: includes/openid-connect-generic-settings-page.php:26 0255 #: includes/openid-connect-generic-settings-page.php:262 257 256 msgid "Token Validation Endpoint URL" 258 257 msgstr "" 259 258 260 #: includes/openid-connect-generic-settings-page.php:26 1259 #: includes/openid-connect-generic-settings-page.php:263 261 260 msgid "Identify provider token endpoint." 262 261 msgstr "" 263 262 264 #: includes/openid-connect-generic-settings-page.php:2 68263 #: includes/openid-connect-generic-settings-page.php:270 265 264 msgid "End Session Endpoint URL" 266 265 msgstr "" 267 266 268 #: includes/openid-connect-generic-settings-page.php:2 69267 #: includes/openid-connect-generic-settings-page.php:271 269 268 msgid "Identify provider logout endpoint." 270 269 msgstr "" 271 270 272 #: includes/openid-connect-generic-settings-page.php:276 271 #: includes/openid-connect-generic-settings-page.php:278 272 msgid "ACR values" 273 msgstr "" 274 275 #: includes/openid-connect-generic-settings-page.php:279 276 msgid "Use a specific defined authentication contract from the IDP - optional." 277 msgstr "" 278 279 #: includes/openid-connect-generic-settings-page.php:285 273 280 msgid "Identity Key" 274 281 msgstr "" 275 282 276 #: includes/openid-connect-generic-settings-page.php:2 77283 #: includes/openid-connect-generic-settings-page.php:286 277 284 msgid "" 278 285 "Where in the user claim array to find the user's identification data. " … … 281 288 msgstr "" 282 289 283 #: includes/openid-connect-generic-settings-page.php:2 83290 #: includes/openid-connect-generic-settings-page.php:292 284 291 msgid "Disable SSL Verify" 285 292 msgstr "" 286 293 287 #: includes/openid-connect-generic-settings-page.php:2 85294 #: includes/openid-connect-generic-settings-page.php:294 288 295 #. translators: %1$s HTML tags for layout/styles, %2$s closing HTML tag for 289 296 #. styles. … … 296 303 msgstr "" 297 304 298 #: includes/openid-connect-generic-settings-page.php:29 0305 #: includes/openid-connect-generic-settings-page.php:299 299 306 msgid "HTTP Request Timeout" 300 307 msgstr "" 301 308 302 #: includes/openid-connect-generic-settings-page.php: 291309 #: includes/openid-connect-generic-settings-page.php:300 303 310 msgid "Set the timeout for requests made to the IDP. Default value is 5." 304 311 msgstr "" 305 312 306 #: includes/openid-connect-generic-settings-page.php: 297313 #: includes/openid-connect-generic-settings-page.php:306 307 314 msgid "Enforce Privacy" 308 315 msgstr "" 309 316 310 #: includes/openid-connect-generic-settings-page.php: 298317 #: includes/openid-connect-generic-settings-page.php:307 311 318 msgid "Require users be logged in to see the site." 312 319 msgstr "" 313 320 314 #: includes/openid-connect-generic-settings-page.php:3 03321 #: includes/openid-connect-generic-settings-page.php:313 315 322 msgid "Alternate Redirect URI" 316 323 msgstr "" 317 324 318 #: includes/openid-connect-generic-settings-page.php:3 04325 #: includes/openid-connect-generic-settings-page.php:314 319 326 msgid "" 320 327 "Provide an alternative redirect route. Useful if your server is causing " … … 324 331 msgstr "" 325 332 326 #: includes/openid-connect-generic-settings-page.php:3 09333 #: includes/openid-connect-generic-settings-page.php:319 327 334 msgid "Nickname Key" 328 335 msgstr "" 329 336 330 #: includes/openid-connect-generic-settings-page.php:3 10337 #: includes/openid-connect-generic-settings-page.php:320 331 338 msgid "" 332 339 "Where in the user claim array to find the user's nickname. Possible " … … 334 341 msgstr "" 335 342 336 #: includes/openid-connect-generic-settings-page.php:3 16343 #: includes/openid-connect-generic-settings-page.php:326 337 344 msgid "Email Formatting" 338 345 msgstr "" 339 346 340 #: includes/openid-connect-generic-settings-page.php:3 17347 #: includes/openid-connect-generic-settings-page.php:327 341 348 msgid "" 342 349 "String from which the user's email address is built. Specify \"{email}\" as " … … 344 351 msgstr "" 345 352 346 #: includes/openid-connect-generic-settings-page.php:3 23353 #: includes/openid-connect-generic-settings-page.php:333 347 354 msgid "Display Name Formatting" 348 355 msgstr "" 349 356 350 #: includes/openid-connect-generic-settings-page.php:3 24357 #: includes/openid-connect-generic-settings-page.php:334 351 358 msgid "String from which the user's display name is built." 352 359 msgstr "" 353 360 354 #: includes/openid-connect-generic-settings-page.php:3 30361 #: includes/openid-connect-generic-settings-page.php:340 355 362 msgid "Identify with User Name" 356 363 msgstr "" 357 364 358 #: includes/openid-connect-generic-settings-page.php:3 31365 #: includes/openid-connect-generic-settings-page.php:341 359 366 msgid "" 360 367 "If checked, the user's identity will be determined by the user name instead " … … 362 369 msgstr "" 363 370 364 #: includes/openid-connect-generic-settings-page.php:3 36371 #: includes/openid-connect-generic-settings-page.php:346 365 372 msgid "State time limit" 366 373 msgstr "" 367 374 368 #: includes/openid-connect-generic-settings-page.php:3 37375 #: includes/openid-connect-generic-settings-page.php:347 369 376 msgid "State valid time in seconds. Defaults to 180" 370 377 msgstr "" 371 378 372 #: includes/openid-connect-generic-settings-page.php:3 42379 #: includes/openid-connect-generic-settings-page.php:352 373 380 msgid "Enable Refresh Token" 374 381 msgstr "" 375 382 376 #: includes/openid-connect-generic-settings-page.php:3 43383 #: includes/openid-connect-generic-settings-page.php:353 377 384 msgid "" 378 385 "If checked, support refresh tokens used to obtain access tokens from " … … 380 387 msgstr "" 381 388 382 #: includes/openid-connect-generic-settings-page.php:3 48389 #: includes/openid-connect-generic-settings-page.php:358 383 390 msgid "Link Existing Users" 384 391 msgstr "" 385 392 386 #: includes/openid-connect-generic-settings-page.php:3 49393 #: includes/openid-connect-generic-settings-page.php:359 387 394 msgid "" 388 395 "If a WordPress account already exists with the same identity as a " … … 391 398 msgstr "" 392 399 393 #: includes/openid-connect-generic-settings-page.php:3 54400 #: includes/openid-connect-generic-settings-page.php:365 394 401 msgid "Create user if does not exist" 395 402 msgstr "" 396 403 397 #: includes/openid-connect-generic-settings-page.php:3 55398 msgid "" 399 "If the user identity is not link to an existing Wordpress user, it is "400 "created. If this setting is not enabled and if the user authenticates with "401 "an account which is not link to an existing Wordpress userthen the "402 "authentication failed"403 msgstr "" 404 405 #: includes/openid-connect-generic-settings-page.php:3 60404 #: includes/openid-connect-generic-settings-page.php:366 405 msgid "" 406 "If the user identity is not linked to an existing WordPress user, it is " 407 "created. If this setting is not enabled, and if the user authenticates with " 408 "an account which is not linked to an existing WordPress user, then the " 409 "authentication will fail." 410 msgstr "" 411 412 #: includes/openid-connect-generic-settings-page.php:372 406 413 msgid "Redirect Back to Origin Page" 407 414 msgstr "" 408 415 409 #: includes/openid-connect-generic-settings-page.php:3 61416 #: includes/openid-connect-generic-settings-page.php:373 410 417 msgid "" 411 418 "After a successful OpenID Connect authentication, this will redirect the " … … 418 425 msgstr "" 419 426 420 #: includes/openid-connect-generic-settings-page.php:3 66427 #: includes/openid-connect-generic-settings-page.php:379 421 428 msgid "Redirect to the login screen when session is expired" 422 429 msgstr "" 423 430 424 #: includes/openid-connect-generic-settings-page.php:3 67431 #: includes/openid-connect-generic-settings-page.php:380 425 432 msgid "" 426 433 "When enabled, this will automatically redirect the user back to the " … … 428 435 msgstr "" 429 436 430 #: includes/openid-connect-generic-settings-page.php:3 72437 #: includes/openid-connect-generic-settings-page.php:386 431 438 msgid "Enable Logging" 432 439 msgstr "" 433 440 434 #: includes/openid-connect-generic-settings-page.php:3 73441 #: includes/openid-connect-generic-settings-page.php:387 435 442 msgid "Very simple log messages for debugging purposes." 436 443 msgstr "" 437 444 438 #: includes/openid-connect-generic-settings-page.php:3 78445 #: includes/openid-connect-generic-settings-page.php:392 439 446 msgid "Log Limit" 440 447 msgstr "" 441 448 442 #: includes/openid-connect-generic-settings-page.php:3 79449 #: includes/openid-connect-generic-settings-page.php:393 443 450 msgid "" 444 451 "Number of items to keep in the log. These logs are stored as an option in " … … 446 453 msgstr "" 447 454 448 #: includes/openid-connect-generic-settings-page.php:4 39455 #: includes/openid-connect-generic-settings-page.php:455 449 456 msgid "Notes" 450 457 msgstr "" 451 458 452 #: includes/openid-connect-generic-settings-page.php:4 42459 #: includes/openid-connect-generic-settings-page.php:458 453 460 msgid "Redirect URI" 454 461 msgstr "" 455 462 456 #: includes/openid-connect-generic-settings-page.php:4 46463 #: includes/openid-connect-generic-settings-page.php:462 457 464 msgid "Login Button Shortcode" 458 465 msgstr "" 459 466 460 #: includes/openid-connect-generic-settings-page.php:4 50467 #: includes/openid-connect-generic-settings-page.php:466 461 468 msgid "Authentication URL Shortcode" 462 469 msgstr "" 463 470 464 #: includes/openid-connect-generic-settings-page.php:4 55471 #: includes/openid-connect-generic-settings-page.php:471 465 472 msgid "Logs" 466 473 msgstr "" 467 474 468 #: includes/openid-connect-generic-settings-page.php:5 35475 #: includes/openid-connect-generic-settings-page.php:551 469 476 msgid "Example" 470 477 msgstr "" 471 478 472 #: includes/openid-connect-generic-settings-page.php:5 48479 #: includes/openid-connect-generic-settings-page.php:564 473 480 msgid "Enter your OpenID Connect identity provider settings." 474 481 msgstr "" 475 482 476 #: includes/openid-connect-generic-settings-page.php:5 57483 #: includes/openid-connect-generic-settings-page.php:573 477 484 msgid "Modify the interaction between OpenID Connect and WordPress users." 478 485 msgstr "" 479 486 480 #: includes/openid-connect-generic-settings-page.php:5 66487 #: includes/openid-connect-generic-settings-page.php:582 481 488 msgid "Control the authorization mechanics of the site." 482 489 msgstr "" 483 490 484 #: includes/openid-connect-generic-settings-page.php:5 75491 #: includes/openid-connect-generic-settings-page.php:591 485 492 msgid "Log information about login attempts through OpenID Connect Generic." 486 493 msgstr "" 487 494 488 #: openid-connect-generic.php:2 02495 #: openid-connect-generic.php:213 489 496 msgid "Private site" 490 497 msgstr "" -
daggerhart-openid-connect-generic/trunk/openid-connect-generic.php
r2516022 r2698055 17 17 * Plugin URI: https://github.com/daggerhart/openid-connect-generic 18 18 * Description: Connect to an OpenID Connect generic client using Authorization Code Flow. 19 * Version: 3.8.5 19 * Version: 3.9.0 20 * Requires at least: 4.9 21 * Requires PHP: 7.2 20 22 * Author: daggerhart 21 23 * Author URI: http://www.daggerhart.com … … 45 47 46 48 Actions 47 - openid-connect-generic-user-create - 2 args: fires when a new user is created by this plugin 48 - openid-connect-generic-user-update - 1 arg: user ID, fires when user is updated by this plugin 49 - openid-connect-generic-update-user-using-current-claim - 2 args: fires every time an existing user logs 50 - openid-connect-generic-redirect-user-back - 2 args: $redirect_url, $user. Allows interruption of redirect during login. 51 - openid-connect-generic-user-logged-in - 1 arg: $user, fires when user is logged in. 52 - openid-connect-generic-cron-daily - daily cron action 53 - openid-connect-generic-state-not-found - the given state does not exist in the database, regardless of its expiration. 54 - openid-connect-generic-state-expired - the given state exists, but expired before this login attempt. 49 - openid-connect-generic-user-create - 2 args: fires when a new user is created by this plugin 50 - openid-connect-generic-user-update - 1 arg: user ID, fires when user is updated by this plugin 51 - openid-connect-generic-update-user-using-current-claim - 2 args: fires every time an existing user logs in and the claims are updated. 52 - openid-connect-generic-redirect-user-back - 2 args: $redirect_url, $user. Allows interruption of redirect during login. 53 - openid-connect-generic-user-logged-in - 1 arg: $user, fires when user is logged in. 54 - openid-connect-generic-cron-daily - daily cron action 55 - openid-connect-generic-state-not-found - the given state does not exist in the database, regardless of its expiration. 56 - openid-connect-generic-state-expired - the given state exists, but expired before this login attempt. 57 58 Callable actions 55 59 56 60 User Meta … … 77 81 78 82 /** 83 * Singleton instance of self 84 * 85 * @var OpenID_Connect_Generic 86 */ 87 protected static $_instance = null; 88 89 /** 79 90 * Plugin version. 80 91 * 81 * @var 82 */ 83 const VERSION = '3. 8.5';92 * @var string 93 */ 94 const VERSION = '3.9.0'; 84 95 85 96 /** … … 109 120 * @var OpenID_Connect_Generic_Client_Wrapper 110 121 */ 111 p rivate$client_wrapper;122 public $client_wrapper; 112 123 113 124 /** … … 122 133 $this->settings = $settings; 123 134 $this->logger = $logger; 135 self::$_instance = $this; 124 136 } 125 137 … … 130 142 */ 131 143 public function init() { 132 133 wp_enqueue_style( 'daggerhart-openid-connect-generic-admin', plugin_dir_url( __FILE__ ) . 'css/styles-admin.css', array(), self::VERSION, 'all' );134 144 135 145 $redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); … … 152 162 $this->settings->endpoint_token, 153 163 $redirect_uri, 164 $this->settings->acr_values, 154 165 $state_time_limit, 155 166 $this->logger … … 328 339 array( 329 340 // OAuth client settings. 330 'login_type' => 'button',341 'login_type' => defined( 'OIDC_LOGIN_TYPE' ) ? OIDC_LOGIN_TYPE : 'button', 331 342 'client_id' => defined( 'OIDC_CLIENT_ID' ) ? OIDC_CLIENT_ID : '', 332 343 'client_secret' => defined( 'OIDC_CLIENT_SECRET' ) ? OIDC_CLIENT_SECRET : '', 333 'scope' => '',344 'scope' => defined( 'OIDC_CLIENT_SCOPE' ) ? OIDC_CLIENT_SCOPE : '', 334 345 'endpoint_login' => defined( 'OIDC_ENDPOINT_LOGIN_URL' ) ? OIDC_ENDPOINT_LOGIN_URL : '', 335 346 'endpoint_userinfo' => defined( 'OIDC_ENDPOINT_USERINFO_URL' ) ? OIDC_ENDPOINT_USERINFO_URL : '', 336 347 'endpoint_token' => defined( 'OIDC_ENDPOINT_TOKEN_URL' ) ? OIDC_ENDPOINT_TOKEN_URL : '', 337 348 'endpoint_end_session' => defined( 'OIDC_ENDPOINT_LOGOUT_URL' ) ? OIDC_ENDPOINT_LOGOUT_URL : '', 349 'acr_values' => defined( 'OIDC_ACR_VALUES' ) ? OIDC_ACR_VALUES : '', 338 350 339 351 // Non-standard settings. … … 347 359 348 360 // Plugin settings. 349 'enforce_privacy' => 0,361 'enforce_privacy' => defined( 'OIDC_ENFORCE_PRIVACY' ) ? intval( OIDC_ENFORCE_PRIVACY ) : 0, 350 362 'alternate_redirect_uri' => 0, 351 363 'token_refresh_enable' => 1, 352 'link_existing_users' => 0,353 'create_if_does_not_exist' => 1,354 'redirect_user_back' => 0,355 'redirect_on_logout' => 1,364 'link_existing_users' => defined( 'OIDC_LINK_EXISTING_USERS' ) ? intval( OIDC_LINK_EXISTING_USERS ) : 0, 365 'create_if_does_not_exist' => defined( 'OIDC_CREATE_IF_DOES_NOT_EXIST' ) ? intval( OIDC_CREATE_IF_DOES_NOT_EXIST ) : 1, 366 'redirect_user_back' => defined( 'OIDC_REDIRECT_USER_BACK' ) ? intval( OIDC_REDIRECT_USER_BACK ) : 0, 367 'redirect_on_logout' => defined( 'OIDC_REDIRECT_ON_LOGOUT' ) ? intval( OIDC_REDIRECT_ON_LOGOUT ) : 1, 356 368 'enable_logging' => 0, 357 369 'log_limit' => 1000, … … 371 383 add_filter( 'comment_text_rss', array( $plugin, 'enforce_privacy_feeds' ), 999 ); 372 384 } 385 386 /** 387 * Create (if needed) and return a singleton of self. 388 * 389 * @return OpenID_Connect_Generic 390 */ 391 public static function instance() { 392 if ( null === self::$_instance ) { 393 self::bootstrap(); 394 } 395 return self::$_instance; 396 } 373 397 } 374 398 375 OpenID_Connect_Generic:: bootstrap();399 OpenID_Connect_Generic::instance(); 376 400 377 401 register_activation_hook( __FILE__, array( 'OpenID_Connect_Generic', 'activation' ) ); 378 402 register_deactivation_hook( __FILE__, array( 'OpenID_Connect_Generic', 'deactivation' ) ); 403 404 // Provide publicly accessible plugin helper functions. 405 require_once( 'includes/functions.php' ); -
daggerhart-openid-connect-generic/trunk/readme.txt
r2516022 r2698055 4 4 Tags: security, login, oauth2, openidconnect, apps, authentication, autologin, sso 5 5 Requires at least: 4.9 6 Tested up to: 5. 7.17 Stable tag: 3. 8.58 Requires PHP: 7. 16 Tested up to: 5.9.2 7 Stable tag: 3.9.0 8 Requires PHP: 7.2 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 3.8.5 55 56 * Fix: @timnolte - Fixes missing URL request validation before use & ensure proper current page URL is setup for Redirect Back. 57 * Fix: @timnolte - Fixes Redirect URL Logic to Handle Sub-directory Installs. 58 * Fix: @timnolte - Fixes to provide proper redirect user back for the openid_connect_generic_auth_url shortcode. 54 = 3.9.0 = 55 56 * Feature: @matchaxnb - Added support for additional configuration constants. 57 * Feature: @schanzen - Added support for agregated claims. 58 * Fix: @rkcreation - Fixed access token not updating user metadata after login. 59 * Fix: @danc1248 - Fixed user creation issue on Multisite Networks. 60 * Feature: @RobjS - Added plugin singleton to support for more developer customization. 61 * Feature: @jkouris - Added action hook to allow custom handling of session expiration. 62 * Fix: @tommcc - Fixed admin CSS loading only on the plugin settings screen. 63 * Feature: @rkcreation - Added method to refresh the user claim. 64 * Feature: @Glowsome - Added acr_values support & verification checks that it when defined in options is honored. 65 * Fix: @timnolte - Fixed regression which caused improper fallback on missing claims. 66 * Fix: @slykar - Fixed missing query string handling in redirect URL. 67 * Fix: @timnolte - Fixed issue with some user linking and user creation handling. 68 * Improvement: @timnolte - Fixed plugin settings typos and screen formatting. 69 * Security: @timnolte - Updated build tooling security vulnerabilities. 70 * Improvement: @timnolte - Changed build tooling scripts. 71 72 = 3.8.5 = 73 74 * Fix: @timnolte - Fixed missing URL request validation before use & ensure proper current page URL is setup for Redirect Back. 75 * Fix: @timnolte - Fixed Redirect URL Logic to Handle Sub-directory Installs. 76 * Fix: @timnolte - Fixed issue with redirecting user back when the openid_connect_generic_auth_url shortcode is used. 59 77 60 78 = 3.8.4 =
Note: See TracChangeset
for help on using the changeset viewer.