Class GoogleUserInfo

java.lang.Object
com.alpaca.security.oauth2.userinfo.OAuth2UserInfo
com.alpaca.security.oauth2.userinfo.GoogleUserInfo

public class GoogleUserInfo extends OAuth2UserInfo
OAuth2UserInfo implementation for Google OAuth2 provider.

This class extracts user-specific information from the attributes map provided by Google's OAuth2/OpenID Connect userinfo endpoint. It assumes the standard attribute keys returned by Google, including:

  • sub: the unique user identifier
  • name: the full name
  • given_name: the first (given) name
  • family_name: the last (family) name
  • email: the user's email address
  • picture: the user's profile image URL
  • email_verified: whether the email address has been verified

By extending OAuth2UserInfo, this class centralizes how the application accesses provider-specific user data. It supports safe, consistent access and eases integration when supporting multiple OAuth2 providers.

These keys align with Google's OpenID Connect specification for its UserInfo endpoint. OpenID Connect spec – Userinfo Endpoint

See Also: