Structure
AppleIdentityToken
struct AppleIdentityToken
Overview
See Also: Retrieve the User’s Information from Apple ID Servers
Topics
Structures
struct UserDetectionStatusTaken from https://developer.apple.com/documentation/authenticationservices/asuserdetectionstatus With slight modification to make adding new cases non-breaking.
Initializers
init(from: any Decoder) throwsCreates a new instance by decoding from the given decoder.init(issuer: IssuerClaim, audience: AudienceClaim, expires: ExpirationClaim, issuedAt: IssuedAtClaim, subject: SubjectClaim, nonceSupported: BoolClaim?, nonce: String?, email: String?, orgId: String?, emailVerified: BoolClaim?, isPrivateEmail: BoolClaim?, realUserStatus: AppleIdentityToken.UserDetectionStatus?)
Instance Properties
let audience: AudienceClaimYourclient_idin your Apple Developer account.let email: String?The user’s email address.let emailVerified: BoolClaim?A Boolean value that indicates whether the service has verified the email. The value of this claim is always true because the servers only return verified email addresses.let expires: ExpirationClaimThe expiry time for the token. This value is typically set to 5 minutes.let isPrivateEmail: BoolClaim?A Boolean value that indicates whether the email shared by the user is the proxy address. It is absent (nil) if the user is not using a proxy email address.let issuedAt: IssuedAtClaimThe time the token was issued.let issuer: IssuerClaimThe issuer-registered claim key, which has the value https://appleid.apple.com.let nonce: String?A string value used to associate a client session and an ID token. This value is used to mitigate replay attacks and is present only if passed during the authorization request.let nonceSupported: BoolClaim?A Boolean value that indicates whether the transaction is on a nonce-supported platform. If you sent a nonce in the authorization request but do not see the nonce claim in the ID token, check this claim to determine how to proceed. If this claim returns true you should treat nonce as mandatory and fail the transaction; otherwise, you can proceed treating the nonce as optional.let orgId: String?Managed Apple ID organization (see https://developer.apple.com/documentation/rosterapi/integrating_with_roster_api_and_sign_in_with_apple)let realUserStatus: AppleIdentityToken.UserDetectionStatus?A value that indicates whether the user appears to be a real person.let subject: SubjectClaimThe unique identifier for the user.
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