GoogleTokenProfile

public struct GoogleTokenProfile : TypeSafeGoogleToken

A pre-constructed TypeSafeGoogleToken which contains the default fields that can be requested from Google.

Note that the Optional fields will only be initialized if the subject grants access to the data.

Usage Example:

router.get("/googleProfile") { (user: GoogleTokenProfile, respondWith: (GoogleTokenProfile?, RequestError?) -> Void) in
   respondWith(user, nil)
}
  • id

    The subject’s unique Google identifier.

    Declaration

    Swift

    public let id: String
  • The subject’s display name.

    Declaration

    Swift

    public let name: String
  • The subject’s family name (last name).

    Declaration

    Swift

    public let family_name: String
  • The subject’s given name (first name).

    Declaration

    Swift

    public let given_name: String
  • A URL providing access to the subject’s profile picture.

    Declaration

    Swift

    public let picture: String
  • The subject’s locale, for example: en.

    Declaration

    Swift

    public let locale: String

Optional fields

  • The subject’s gender. The subject may not have provided this information in their Google profile.

    Declaration

    Swift

    public let gender: String?
  • The subject’s e-mail address. The subject may choose not to share this information.

    Declaration

    Swift

    public let email: String?
  • Indicates whether the subject’s e-mail address has been verified. Note that this field is only present if email has been granted.

    Declaration

    Swift

    public let verified_email: Bool?