Table of Contents

Struct NativeAppleIdCredential

Wrapper for iOS's native ASAuthorizationAppleIDCredential.

public struct NativeAppleIdCredential

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 nint AuthorizationCode

Field Value

nint

Email

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

public nint Email

Field Value

nint

FullName

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

public nint FullName

Field Value

nint

Remarks

This is an instance of NativePersonNameComponents. If it has not been unwrapped, it will be freed when this struct's Dispose() is called. If unwrapped using UnwrapFullName(), the caller is responsible for disposing the returned object.

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 nint IdentityToken

Field Value

nint

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 byte RealUserStatus

Field Value

byte

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 byte Scopes

Field Value

byte

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 nint State

Field Value

nint

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 byte UserAgeRange

Field Value

byte

UserId

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

public nint UserId

Field Value

nint

Methods

Dispose()

Deallocates native resources.

public void Dispose()

Remarks

This struct has been intentionally not set as IDisposable to prevent accidental struct copies caused by "using" statements.

UnwrapFullName()

Unwraps FullName into an instance of NativePersonNameComponents.

public NativePersonNameComponents? UnwrapFullName()

Returns

NativePersonNameComponents?

The unwrapped struct or null if FullName is a nullptr.

Remarks

This can only be called once, as after FullName is unwrapped, the reference is deallocated. This is to prevent multiple copies of the same memory from being created.