invertase / invertase/react-native-apple-authentication

Question: Does getCredentialStateForUser reliably return State.TRANSFERRED after an App transfer?

Open
#381 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.7k
Forks
236
PR merge metrics
No merged PRs in 30d

Description

Hi,

We are currently planning to transfer our iOS application to a new Apple Developer Team, and we have a critical concern regarding the behavior of `appleAuth.getCredentialStateForUser(user)` for our existing users.

In our current and older versions of the app (which are already in production and installed on users' devices), we strictly check if the credential state is `AUTHORIZED` right after `performRequest()`:

```typescript
const appleRes = await appleAuth.performRequest({
requestedOperation: appleAuth.Operation.LOGIN,
requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL],
});

const credentialState = await appleAuth.getCredentialStateForUser(appleRes.user);

// Our legacy code strictly hardcoded this check to 1 (AUTHORIZED)
if (identityToken && credentialState === appleAuth.State.AUTHORIZED) {
// Proceed to our backend login
} else {
// Block login and show error
}
```

According to [Apple's App Transfer documentation](https://developer.apple.com/documentation/signinwithapple/transferring-your-apps-and-users-to-another-team), the credential state for existing users becomes ASAuthorizationAppleIDProviderCredentialStateTransferred after the transfer.

My questions are:

Will appleAuth.getCredentialStateForUser(user) definitively return appleAuth.State.TRANSFERRED (value 3) when an existing user tries to sign in after the Team transfer?
If so, does this mean our older app versions will completely block existing users from logging in because we only allowed credentialState === 1?
Or is it possible that a fresh invocation of appleAuth.performRequest() overrides the transferred state and still returns AUTHORIZED (value 1), allowing our legacy code to survive during the migration period?
Any insights or clarifications from your past experiences with app transfers using this library would be highly appreciated. Thank you so much!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.