Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,16 @@ - (void)updateCredentials:(NSDictionary *) params {
if (params[kSFOAuthTokenFormat]) {
self.tokenFormat = params[kSFOAuthTokenFormat];
}
// TODO: Remove kSFOAuthLegacyBeaconChildConsumer* fallback once server version 264 has rolled out everywhere.

@wmathurin wmathurin Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That way we can go against older instances and it should still work.

if (params[kSFOAuthBeaconChildConsumerKey]) {
self.beaconChildConsumerKey = params[kSFOAuthBeaconChildConsumerKey];
} else if (params[kSFOAuthLegacyBeaconChildConsumerKey]) {
self.beaconChildConsumerKey = params[kSFOAuthLegacyBeaconChildConsumerKey];
}
if (params[kSFOAuthBeaconChildConsumerSecret]) {
self.beaconChildConsumerSecret = params[kSFOAuthBeaconChildConsumerSecret];
} else if (params[kSFOAuthLegacyBeaconChildConsumerSecret]) {
self.beaconChildConsumerSecret = params[kSFOAuthLegacyBeaconChildConsumerSecret];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ static NSString * const kSFOAuthCookieSidClient = @"cookie-sid_C
static NSString * const kSFOAuthSidCookieName = @"sidCookieName";
static NSString * const kSFOAuthParentSid = @"parent_sid";
static NSString * const kSFOAuthTokenFormat = @"token_format";
static NSString * const kSFOAuthBeaconChildConsumerKey = @"beacon_child_consumer_key";
static NSString * const kSFOAuthBeaconChildConsumerSecret = @"beacon_child_consumer_secret";
static NSString * const kSFOAuthBeaconChildConsumerKey = @"auto_installed_app_org_consumer_key";
static NSString * const kSFOAuthBeaconChildConsumerSecret = @"auto_installed_app_org_consumer_secret";
// TODO: Remove legacy fallback constants once server version 264 has rolled out everywhere.
static NSString * const kSFOAuthLegacyBeaconChildConsumerKey = @"beacon_child_consumer_key";
static NSString * const kSFOAuthLegacyBeaconChildConsumerSecret = @"beacon_child_consumer_secret";


// Used for the IP bypass flow, Advanced auth flow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ - (void)tryUpdateCredentials:(BOOL)encrypted storageType:(SFOAuthCredentialsStor
[params setObject:@"test-sid-cookie-name" forKey:@"sidCookieName"];
[params setObject:@"test-parent-sid" forKey:@"parent_sid"];
[params setObject:@"test-token-format" forKey:@"token_format"];
[params setObject:@"test-beacon-child-consumer-key" forKey:@"beacon_child_consumer_key"];
[params setObject:@"test-beacon-child-consumer-secret" forKey:@"beacon_child_consumer_secret"];
[params setObject:@"test-beacon-child-consumer-key" forKey:@"auto_installed_app_org_consumer_key"];
[params setObject:@"test-beacon-child-consumer-secret" forKey:@"auto_installed_app_org_consumer_secret"];
[creds updateCredentials:params];

// Check updated SFOAuthCredentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ - (void)testInitWithDictionary {
[params setObject:@"test-sid-cookie-name" forKey:@"sidCookieName"];
[params setObject:@"test-parent-sid" forKey:@"parent_sid"];
[params setObject:@"test-token-format" forKey:@"token_format"];
[params setObject:@"test-beacon-child-consumer-key" forKey:@"beacon_child_consumer_key"];
[params setObject:@"test-beacon-child-consumer-secret" forKey:@"beacon_child_consumer_secret"];
[params setObject:@"test-beacon-child-consumer-key" forKey:@"auto_installed_app_org_consumer_key"];
[params setObject:@"test-beacon-child-consumer-secret" forKey:@"auto_installed_app_org_consumer_secret"];

// Additional fields
NSArray<NSString *>* additionalFields = @[ @"additional-1", @"additional-2" ];
Expand Down
Loading