Structure
GoogleIdentityToken
struct GoogleIdentityToken
Overview
See Also: An ID token’s payload
Topics
Initializers
init(from: any Decoder) throwsCreates a new instance by decoding from the given decoder.init(issuer: IssuerClaim, subject: SubjectClaim, audience: AudienceClaim, authorizedPresenter: String, issuedAt: IssuedAtClaim, expires: ExpirationClaim, atHash: String?, hostedDomain: GoogleHostedDomainClaim?, email: String?, emailVerified: BoolClaim?, name: String?, picture: String?, profile: String?, givenName: String?, familyName: String?, locale: LocaleClaim?, nonce: String?)
Instance Properties
let atHash: String?Access token hash.let audience: AudienceClaimThe audience that this ID token is intended for. It must be one of the OAuth 2.0 client IDs of your application.let authorizedPresenter: StringThe client_id of the authorized presenter.let email: String?The user’s email address.let emailVerified: BoolClaim?Trueif the user’s e-mail address has been verified; otherwisefalse.let expires: ExpirationClaimExpiration time on or after which the ID token must not be accepted.let familyName: String?The user’s surname(s) or last name(s). Might be provided when anameclaim is present.let givenName: String?The user’s given name(s) or first name(s). Might be provided when anameclaim is present.let hostedDomain: GoogleHostedDomainClaim?The hosted G Suite domain of the user. Provided only if the user belongs to a hosted domain.let issuedAt: IssuedAtClaimThe time the ID token was issued.let issuer: IssuerClaimThe Issuer Identifier for the Issuer of the response. Always https://accounts.google.com or accounts.google.com for Google ID tokens.let locale: LocaleClaim?The user’s locale, represented by a BCP 47 language tag. Might be provided when a name claim is present.let name: String?The user’s full name, in a displayable form.let nonce: String?The value of the nonce supplied by your app in the authentication request. You should enforce protection against replay attacks by ensuring it is presented only once.let picture: String?The URL of the user’s profile picture.let profile: String?The URL of the user’s profile picture.let subject: SubjectClaimAn identifier for the user, unique among all Google accounts and never reused.
Instance Methods
func verify(using: some JWTAlgorithm) throwsVerifies that the payload’s claims are correct or throws an error.
Relationships
Conforms To
JWTPayloadSwift.DecodableSwift.EncodableSwift.SendableSwift.SendableMetatype