Skip to content

Allow for identifying users who registered via Sign in with Google #11341

@jamesozzie

Description

@jamesozzie

Feature Description

As suggested by a user in the support forums, consider adding a sk- or other prefix for those who happen to register on a site using Sign in with Google, or the one tap feature.

This would allow site administrators to easily see which users are connected through their Google account.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • When creating a new user via Sign in with Google, a persistent meta value should be added to identify the user as created by the module.

Implementation Brief

  • Update Sign_In_With_Google\Authenticator::create_user to include an additional key/value pair to meta_input as googlesitekitpersistent_created_by: sign-in-with-google, similar to the way the hashed ID is set

Test Coverage

  • Update AuthenticatorTest to cover the new behavior

QA Brief

The QA Brief should be following for two scenarios:

  1. On a site using WordPress 5.2-5.8
  2. On a site with WordPress 5.9+ (WordPress 7.0/latest release is fine)
  • Set up Sign in with Google in Site Kit and enable open user registration in Settings > General > Membership.
  • In an incognito browser, click "Sign in with Google" on the WordPress login screen and complete the OAuth flow with a Google account whose email is NOT yet a WP user. Confirm the new user is created, signed in to the admin without errors, and visible at Users, All Users with the expected name and role.
  • Open the database using phpMyAdmin, browse wp_usermeta, filter by the new user's user_id, and confirm two rows:
    • wp_googlesitekitpersistent_created_by = sign-in-with-google
    • wp_googlesitekitpersistent_siwg_google_user_hid = a 32-character hash string

Changelog entry

  • Add a meta key for users whose account is created with Sign in with Google

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions