Skip to content

Commit 5342fe2

Browse files
committed
Aligning logout reasons with Android
* during login when signout out an existing user matching the newly logged in user, Android uses REFRESH_TOKEN_ROTATED while iOS was using SFLogoutReasonUnknown See https://github.com/forcedotcom/SalesforceMobileSDK-Android/blob/dev/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/AuthenticationUtilities.kt#L163 and https://github.com/forcedotcom/SalesforceMobileSDK-Android/blob/dev/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/OAuthWebviewHelper.kt#L529 * on login with bio auth enabled, when signing out existing users (which should not happen because we only support one bio auth user) Android uses UNEXPECTED while iOS was using SFLogoutReasonRefreshTokenRotated See https://github.com/forcedotcom/SalesforceMobileSDK-Android/blob/dev/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/AuthenticationUtilities.kt#L176
1 parent 2765a54 commit 5342fe2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

libs/SalesforceSDKCore/SalesforceSDKCore/Classes/UserAccount/SFUserAccountManager.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,8 +1574,9 @@ - (void)setCurrentUserInternal:(SFUserAccount*)user {
15741574
NSArray *keys = [self.userAccountMap allKeys];
15751575
for (SFUserAccountIdentity *identity in keys) {
15761576
// Logout any other user with Biometric Authentication
1577+
// This is an unexpected logout(s) because we only support one Bio Auth user.
15771578
if ([bioAuthManager checkForPolicyWithUserId:identity.userId] && ![identity isEqual:[self currentUserIdentity]]) {
1578-
[self logoutUser:[self userAccountForUserIdentity:identity] reason:SFLogoutReasonRefreshTokenRotated];
1579+
[self logoutUser:[self userAccountForUserIdentity:identity] reason:SFLogoutReasonUnexpected];
15791580
}
15801581
}
15811582
}
@@ -1821,7 +1822,7 @@ - (void)retrievedIdentityData:(SFSDKAuthSession *)authSession {
18211822
if (preLoginCredentials != nil && ![preLoginCredentials.refreshToken isEqualToString:self.currentUser.credentials.refreshToken]) {
18221823

18231824
id<SFSDKOAuthProtocol> authClient = self.authClient();
1824-
[authClient revokeRefreshToken:preLoginCredentials reason:SFLogoutReasonUnknown];
1825+
[authClient revokeRefreshToken:preLoginCredentials reason:SFLogoutReasonRefreshTokenRotated];
18251826
}
18261827
} else if (hasMobilePolicy) {
18271828
[SFSDKAppFeatureMarkers registerAppFeature:kSFAppFeatureScreenLock];

0 commit comments

Comments
 (0)