diff --git a/GoogleSignIn/Sources/GIDSignIn.m b/GoogleSignIn/Sources/GIDSignIn.m index 48b6d749..1c043735 100644 --- a/GoogleSignIn/Sources/GIDSignIn.m +++ b/GoogleSignIn/Sources/GIDSignIn.m @@ -541,6 +541,8 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore authStateMigrationService:(GIDAuthStateMigration *)authStateMigrationService { self = [super init]; if (self) { + _keychainStore = keychainStore; + // Get the bundle of the current executable. NSBundle *bundle = NSBundle.mainBundle; @@ -552,11 +554,6 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore // Check to see if the 3P app is being run for the first time after a fresh install. BOOL isFreshInstall = [self isFreshInstall]; - // If this is a fresh install, ensure that any pre-existing keychain data is purged. - if (isFreshInstall) { - [self removeAllKeychainEntries]; - } - NSString *authorizationEnpointURL = [NSString stringWithFormat:kAuthorizationURLTemplate, [GIDSignInPreferences googleAuthorizationServer]]; NSString *tokenEndpointURL = [NSString stringWithFormat:kTokenURLTemplate, @@ -564,7 +561,6 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore _appAuthConfiguration = [[OIDServiceConfiguration alloc] initWithAuthorizationEndpoint:[NSURL URLWithString:authorizationEnpointURL] tokenEndpoint:[NSURL URLWithString:tokenEndpointURL]]; - _keychainStore = keychainStore; // Perform migration of auth state from old versions of the SDK if needed. [authStateMigrationService migrateIfNeededWithTokenURL:_appAuthConfiguration.tokenEndpoint callbackPath:kBrowserCallbackPath