Changeset 3458536
- Timestamp:
- 02/10/2026 10:58:40 PM (7 weeks ago)
- Location:
- daggerhart-openid-connect-generic
- Files:
-
- 8 edited
- 1 copied
-
tags/3.10.4 (copied) (copied from daggerhart-openid-connect-generic/trunk)
-
tags/3.10.4/includes/openid-connect-generic-client-wrapper.php (modified) (2 diffs)
-
tags/3.10.4/includes/openid-connect-generic-client.php (modified) (1 diff)
-
tags/3.10.4/openid-connect-generic.php (modified) (3 diffs)
-
tags/3.10.4/readme.txt (modified) (2 diffs)
-
trunk/includes/openid-connect-generic-client-wrapper.php (modified) (2 diffs)
-
trunk/includes/openid-connect-generic-client.php (modified) (1 diff)
-
trunk/openid-connect-generic.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
daggerhart-openid-connect-generic/tags/3.10.4/includes/openid-connect-generic-client-wrapper.php
r3454892 r3458536 441 441 442 442 if ( is_wp_error( $authentication_request ) ) { 443 // Check if this is a retryable IDP error (e.g. Safari ITP causing 444 // Keycloak session cookies to be blocked on cross-site navigation). 445 $retryable_idp_errors = array( 446 'temporarily_unavailable', 447 'authentication_expired', 448 'login_required', 449 ); 450 451 $error_code = $authentication_request->get_error_code(); 452 $is_retryable = in_array( $error_code, $retryable_idp_errors, true ); 453 $already_retried = isset( $_GET['openid-connect-generic-retry'] ); 454 455 if ( $is_retryable && ! $already_retried ) { 456 // Log the original error before retrying. 457 $this->logger->log( $authentication_request, 'retry' ); 458 $this->logger->log( "Retrying authentication due to IDP error: {$error_code}", 'retry' ); 459 460 // Build a fresh authentication URL and append a retry flag 461 // to prevent infinite redirect loops (max 1 retry). 462 $auth_url = $this->get_authentication_url(); 463 $auth_url = add_query_arg( 'openid-connect-generic-retry', '1', $auth_url ); 464 465 wp_redirect( $auth_url ); 466 exit; 467 } 468 443 469 $this->error_redirect( $authentication_request ); 444 470 } … … 727 753 */ 728 754 public function get_user_by_identity( $subject_identity ) { 755 global $wpdb; 756 729 757 // Look for user by their openid-connect-generic-subject-identity value. 730 758 $user_query = new WP_User_Query( 731 759 array( 732 760 'meta_query' => array( 761 'relation' => 'OR', 733 762 array( 734 763 'key' => 'openid-connect-generic-subject-identity', 764 'value' => $subject_identity, 765 ), 766 array( 767 'key' => $wpdb->get_blog_prefix() . 'openid-connect-generic-subject-identity', 735 768 'value' => $subject_identity, 736 769 ), -
daggerhart-openid-connect-generic/tags/3.10.4/includes/openid-connect-generic-client.php
r3454892 r3458536 163 163 // Look for an existing error of some kind. 164 164 if ( isset( $request['error'] ) ) { 165 return new WP_Error( 'unknown-error', 'An unknown error occurred.', $request ); 165 $error_code = sanitize_text_field( $request['error'] ); 166 $error_message = 'An unknown error occurred.'; 167 168 // Use the IDP's error description if available for better diagnostics. 169 if ( ! empty( $request['error_description'] ) ) { 170 $error_message = sprintf( 171 'IDP error %s: %s', 172 $error_code, 173 sanitize_text_field( $request['error_description'] ) 174 ); 175 } 176 177 return new WP_Error( $error_code, $error_message, $request ); 166 178 } 167 179 -
daggerhart-openid-connect-generic/tags/3.10.4/openid-connect-generic.php
r3454892 r3458536 17 17 * Plugin URI: https://github.com/oidc-wp/openid-connect-generic 18 18 * Description: Connect to an OpenID Connect identity provider using Authorization Code Flow. 19 * Version: 3.10. 319 * Version: 3.10.4 20 20 * Requires at least: 5.0 21 21 * Requires PHP: 7.4 … … 60 60 Callable actions 61 61 62 User Meta 63 - openid-connect-generic-subject-identity - the identity of the user provided by the idp64 - openid-connect-generic-last-id-token-claim - the user's most recent id_token claim, decoded65 - openid-connect-generic-last-user-claim - the user's most recent user_claim66 - openid-connect-generic-last-token-response - the user's most recent token response62 User Meta (since v3.10.4 prefixed with the blog database prefix, for example wp_2_openid-connect-generic-subject-identity) 63 - [[BLOG_DB_PREFIX]]openid-connect-generic-subject-identity - the identity of the user provided by the idp 64 - [[BLOG_DB_PREFIX]]openid-connect-generic-last-id-token-claim - the user's most recent id_token claim, decoded 65 - [[BLOG_DB_PREFIX]]openid-connect-generic-last-user-claim - the user's most recent user_claim 66 - [[BLOG_DB_PREFIX]]openid-connect-generic-last-token-response - the user's most recent token response 67 67 68 68 Options … … 94 94 * @var string 95 95 */ 96 const VERSION = '3.10. 3';96 const VERSION = '3.10.4'; 97 97 98 98 /** -
daggerhart-openid-connect-generic/tags/3.10.4/readme.txt
r3454892 r3458536 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9.0 6 Stable tag: 3.10. 36 Stable tag: 3.10.4 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 50 50 51 51 == Changelog == 52 53 = 3.10.4 = 54 55 * Fix issue with finding users on multisite after switch to user options in place of user meta. 56 * Improvement: Retry logins for some IDP errors to bypass issue with Safari ITP. Also improves display of error messages that come from the IDP. 52 57 53 58 = 3.10.3 = -
daggerhart-openid-connect-generic/trunk/includes/openid-connect-generic-client-wrapper.php
r3454892 r3458536 441 441 442 442 if ( is_wp_error( $authentication_request ) ) { 443 // Check if this is a retryable IDP error (e.g. Safari ITP causing 444 // Keycloak session cookies to be blocked on cross-site navigation). 445 $retryable_idp_errors = array( 446 'temporarily_unavailable', 447 'authentication_expired', 448 'login_required', 449 ); 450 451 $error_code = $authentication_request->get_error_code(); 452 $is_retryable = in_array( $error_code, $retryable_idp_errors, true ); 453 $already_retried = isset( $_GET['openid-connect-generic-retry'] ); 454 455 if ( $is_retryable && ! $already_retried ) { 456 // Log the original error before retrying. 457 $this->logger->log( $authentication_request, 'retry' ); 458 $this->logger->log( "Retrying authentication due to IDP error: {$error_code}", 'retry' ); 459 460 // Build a fresh authentication URL and append a retry flag 461 // to prevent infinite redirect loops (max 1 retry). 462 $auth_url = $this->get_authentication_url(); 463 $auth_url = add_query_arg( 'openid-connect-generic-retry', '1', $auth_url ); 464 465 wp_redirect( $auth_url ); 466 exit; 467 } 468 443 469 $this->error_redirect( $authentication_request ); 444 470 } … … 727 753 */ 728 754 public function get_user_by_identity( $subject_identity ) { 755 global $wpdb; 756 729 757 // Look for user by their openid-connect-generic-subject-identity value. 730 758 $user_query = new WP_User_Query( 731 759 array( 732 760 'meta_query' => array( 761 'relation' => 'OR', 733 762 array( 734 763 'key' => 'openid-connect-generic-subject-identity', 764 'value' => $subject_identity, 765 ), 766 array( 767 'key' => $wpdb->get_blog_prefix() . 'openid-connect-generic-subject-identity', 735 768 'value' => $subject_identity, 736 769 ), -
daggerhart-openid-connect-generic/trunk/includes/openid-connect-generic-client.php
r3454892 r3458536 163 163 // Look for an existing error of some kind. 164 164 if ( isset( $request['error'] ) ) { 165 return new WP_Error( 'unknown-error', 'An unknown error occurred.', $request ); 165 $error_code = sanitize_text_field( $request['error'] ); 166 $error_message = 'An unknown error occurred.'; 167 168 // Use the IDP's error description if available for better diagnostics. 169 if ( ! empty( $request['error_description'] ) ) { 170 $error_message = sprintf( 171 'IDP error %s: %s', 172 $error_code, 173 sanitize_text_field( $request['error_description'] ) 174 ); 175 } 176 177 return new WP_Error( $error_code, $error_message, $request ); 166 178 } 167 179 -
daggerhart-openid-connect-generic/trunk/openid-connect-generic.php
r3454892 r3458536 17 17 * Plugin URI: https://github.com/oidc-wp/openid-connect-generic 18 18 * Description: Connect to an OpenID Connect identity provider using Authorization Code Flow. 19 * Version: 3.10. 319 * Version: 3.10.4 20 20 * Requires at least: 5.0 21 21 * Requires PHP: 7.4 … … 60 60 Callable actions 61 61 62 User Meta 63 - openid-connect-generic-subject-identity - the identity of the user provided by the idp64 - openid-connect-generic-last-id-token-claim - the user's most recent id_token claim, decoded65 - openid-connect-generic-last-user-claim - the user's most recent user_claim66 - openid-connect-generic-last-token-response - the user's most recent token response62 User Meta (since v3.10.4 prefixed with the blog database prefix, for example wp_2_openid-connect-generic-subject-identity) 63 - [[BLOG_DB_PREFIX]]openid-connect-generic-subject-identity - the identity of the user provided by the idp 64 - [[BLOG_DB_PREFIX]]openid-connect-generic-last-id-token-claim - the user's most recent id_token claim, decoded 65 - [[BLOG_DB_PREFIX]]openid-connect-generic-last-user-claim - the user's most recent user_claim 66 - [[BLOG_DB_PREFIX]]openid-connect-generic-last-token-response - the user's most recent token response 67 67 68 68 Options … … 94 94 * @var string 95 95 */ 96 const VERSION = '3.10. 3';96 const VERSION = '3.10.4'; 97 97 98 98 /** -
daggerhart-openid-connect-generic/trunk/readme.txt
r3454892 r3458536 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9.0 6 Stable tag: 3.10. 36 Stable tag: 3.10.4 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 50 50 51 51 == Changelog == 52 53 = 3.10.4 = 54 55 * Fix issue with finding users on multisite after switch to user options in place of user meta. 56 * Improvement: Retry logins for some IDP errors to bypass issue with Safari ITP. Also improves display of error messages that come from the IDP. 52 57 53 58 = 3.10.3 =
Note: See TracChangeset
for help on using the changeset viewer.