Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove automatic client grant creation #637

Merged
merged 1 commit into from
Mar 25, 2019

Conversation

joshcanhelp
Copy link
Contributor

@joshcanhelp joshcanhelp commented Mar 22, 2019

Changes

In version 3.5.0 and 3.5.1, a Client Credentials grant was automatically created between the WP site and the Management API to retrieve user data. This could only happen if a valid API access token was already saved in the setting page. This grant is no longer required for the plugin to function properly and uncommon for sites that have been live for longer than the token expiration (24 hours be default).

The number of sites that could use this automatic update was small to begin with and the number of sites that are running < 3.5.x are down to 8% (plugin stats).

This PR removes the automatic check and attempted fix in preparation for removing the admin-stored API token. Sites that update from < 3.5 will still receive user data via the ID token and updates that did not function before the update (user email and password updates, email verification resending) will continue to not function but log a clear error message.

This PR also deprecates the methods that would display an admin message if the process failed.

Testing

  • This change adds unit test coverage

Checklist

@joshcanhelp joshcanhelp added this to the 3.10.0 milestone Mar 22, 2019
@@ -441,11 +441,6 @@ public static function uninstall() {
delete_option( 'widget_wp_auth0_widget' );
delete_option( 'widget_wp_auth0_social_amplification_widget' );

delete_option( 'wp_auth0_client_grant_failed' );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Options are removed upon plugin update so no need to remove when the plugin is uninstalled.

@@ -102,128 +98,13 @@ public function install_db( $version_to_install = null, $app_token = '' ) {
}
}

// App token needed for following updates
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API token is no longer used during the migration process.

@@ -335,19 +335,6 @@ public function basic_validation( $old_options, $input ) {
? $input['auth0_app_token'] // TO BE DEPRECATED
: $old_options['auth0_app_token'] ); // TO BE DEPRECATED

// If we have an app token, get and store the audience
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the automatic update attempt when a new API token is saved.

@joshcanhelp joshcanhelp merged commit 14abc7c into master Mar 25, 2019
@joshcanhelp joshcanhelp deleted the remove-automatic-client-grant branch March 25, 2019 21:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants