Pre-condition: Have a host with one member having SK setup
Notice: User is taken back to the dashboard and an Unknown Error is displayed:

_Do not alter or remove anything below. The following sections will be managed by moderators only._
If the user clicks "cancel" at the API scopes granting step, display an informative error message instead of "Unknown Error (access_denied)":
For example:
"Site Kit setup was interrupted because you did not grant the necessary API scopes. To resume setup, start here <- link to the landing page:
https://www.example.com/wp-admin/admin.php?page=googlesitekit-splash
OAuth_Client::get_error_message(), add a new case for access_denied and return the message "Site Kit setup was interrupted because you did not grant the necessary permissions.".Authentication::get_authentication_oauth_error_notice(), in the else clause where it calls OAuth_Client::get_error_message(), add the following string: "To resume setup, start here.", where "start here" links to the setup screen https://www.example.com/wp-admin/admin.php?page=googlesitekit-splash --> this will ensure that link shows for every OAuth error except when you're already on the Site Kit splash screen (no need to link to the current screen)access_denied error code.I think this is to be expected when denying access during OAuth, although we could probably improve the experience to be more informative for the user. I also don't think this is specific to the second user - it should happen with the first as well if OAuth scopes are not approved.
@felixarntz I think we should avoid displaying error messages on the WP dashboard if we can, indeed for the reasons outlined in the AC. Why not redirect to the splash page and display a better error/notice there? Then the user only needs to click "Start setup" to retry.
@aaemnnosttv That's a good point.
Let's keep this issue plain and simple to just add a better error message. However, I'd say we should consistently only link to the splash page if you're not already on the splash page. I'll update the IB.
IB ✅
However, I would suggest a variation of that message since API scopes are not something most people will be familiar with:
- Site Kit setup was interrupted because you did not grant the necessary API scopes.
+ Site Kit setup was interrupted because the necessary permissions were not granted.
I'm going to bump the estimate a little as well since this may likely be done by a new engineer.
@aaemnnosttv
Let's go with "Site Kit setup was interrupted because you did not grant the necessary permissions." - better to be addressing the user here I think
Due to some changes on the proxy (we'll now cause the access_denied error as soon as at least one of the requested scopes is not granted), this is more urgent than before, and we should include this in tomorrow's release. I'll work on a PR.