Interface GroupResolver

All Known Implementing Classes:
CloudIdentityDirectGroupResolver

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public interface GroupResolver
Resolves the Google Groups a user belongs to.

Pluggable so that a future service-account mode (Cloud Identity Groups Reader role or Admin SDK Directory API with domain-wide delegation) can be added without redesigning the realm. The v1 implementation is CloudIdentityDirectGroupResolver, which uses the logged-in user's own OAuth access token.

  • Method Details

    • resolveGroups

      @NonNull List<String> resolveGroups(@NonNull String email, @NonNull String accessToken) throws IOException
      Parameters:
      email - the logged-in user's primary email (lowercase)
      accessToken - an OAuth access token authorized to look up the user's groups
      Returns:
      group emails (lowercase), possibly empty; never null
      Throws:
      IOException - on any lookup failure (network, HTTP 4xx/5xx, malformed response)