Table of Contents

Class AppleIdCredential

An AppleID account credential.

public record AppleIdCredential
Inheritance
object
AppleIdCredential

Constructors

AppleIdCredential(string, string?, AppleIdScope, string?, string?, string?, PersonNameComponents?, AppleIdUserDetectionStatus, AppleIdUserAgeRange)

protected AppleIdCredential(string userId, string? state, AppleIdScope scopes, string? authorizationCode, string? identityToken, string? email, PersonNameComponents? fullName, AppleIdUserDetectionStatus realUserStatus, AppleIdUserAgeRange userAgeRange)

Parameters

userId string
state string
scopes AppleIdScope
authorizationCode string
identityToken string
email string
fullName PersonNameComponents
realUserStatus AppleIdUserDetectionStatus
userAgeRange AppleIdUserAgeRange

Fields

AuthorizationCode

A short-lived, one-time valid token that provides proof of authorization to the server component of the app. The authorization code is bound to the specific transaction using the state attribute passed in the authorization request. The server component of the app can validate the code using Apple's identity service endpoint provided for this purpose.

public readonly string? AuthorizationCode

Field Value

string

Email

An optional email shared by the user. This field is populated with a value that the user authorized.

public readonly string? Email

Field Value

string

FullName

An optional full name shared by the user. This field is populated with a value that the user authorized.

public readonly PersonNameComponents? FullName

Field Value

PersonNameComponents

IdentityToken

A JSON Web Token (JWT) used to communicate information about the identity of the user in a secure way to the app. The ID token will contain the following information: Issuer Identifier, Subject Identifier, Audience, Expiry Time and Issuance Time signed by Apple's identity service.

public readonly string? IdentityToken

Field Value

string

RealUserStatus

Check this property for a hint as to whether the current user is a "real user". See the documentation for ASUserDetectionStatus for guidelines on handling each status.

public readonly AppleIdUserDetectionStatus RealUserStatus

Field Value

AppleIdUserDetectionStatus

Scopes

This value will contain a list of scopes for which the user provided authorization. These may contain a subset of the requested scopes on @see ASAuthorizationAppleIDRequest. The application should query this value to identify which scopes were returned as it maybe different from ones requested.

public readonly AppleIdScope Scopes

Field Value

AppleIdScope

Remarks

TODO: Fix this, it always returns 0.

State

Data that's returned to you unmodified in the corresponding credential after a successful authentication.

public readonly string? State

Field Value

string

UserAgeRange

Check this property to determine whether the current user is a child. See the documentation for ASUserAgeRange for guidelines on handling each status.

public readonly AppleIdUserAgeRange UserAgeRange

Field Value

AppleIdUserAgeRange

UserId

An opaque user ID associated with the AppleID used for the sign in. This identifier will be stable across the 'developer team'.

public readonly string UserId

Field Value

string