-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use single FRT #1470
base: dev
Are you sure you want to change the base?
Use single FRT #1470
Conversation
…action is required
# Conflicts: # IdentityCore/src/MSIDConstants.h # IdentityCore/src/requests/MSIDInteractiveAuthorizationCodeRequest.m
…re flight sent by broker
IdentityCore/src/MSIDConstants.h
Outdated
MSIDIsFRTEnabledStatusNotEnabled = 0, | ||
|
||
// FRT is enabled | ||
MSIDIsFRTEnabledStatusActive, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Is there a difference between enabled and active? If not, can we use the same (enable vs disable) or active/not active
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No difference, updated to enable/disable
|
||
// Check if FRT is enabled by feature flight | ||
MSIDFlightManager *flightManager = [MSIDFlightManager sharedInstance]; | ||
BOOL flagEnableFRT = [flightManager boolForKey:@"enable_client_sfrt_by_tenant_id"]; // TODO: Replace this by the constant from the other branch, and remove the hardcoded YES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do you still need TODO here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will replace this when the other PR (#1489) is merged.
@@ -132,6 +134,77 @@ - (void)acquireTokenWithCodeResult:(MSIDAuthorizationCodeResult *) __unused auth | |||
#endif | |||
} | |||
|
|||
- (void)updateCustomHeadersForFRTSupportIfNeeded | |||
{ | |||
#if !EXCLUDE_FROM_MSALCPP && !AD_BROKER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my learning: Any reason this is not included in OneAuth/MSAL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OneAuth already do this on their side, but we didn't.
|
||
// Check if FRT is enabled by feature flight | ||
MSIDFlightManager *flightManager = [MSIDFlightManager sharedInstance]; | ||
BOOL flagEnableFRT = [flightManager boolForKey:@"enable_client_sfrt_by_tenant_id"];// || YES; // TODO: Replace this by the constant from the other branch, and remove the hardcoded YES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO still need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the other PR merged, I have replaced this string with the right constant.
IdentityCore/src/MSIDBasicContext.h
Outdated
@@ -32,6 +32,7 @@ NS_ASSUME_NONNULL_BEGIN | |||
@property (nonatomic, nullable) NSString *logComponent; | |||
@property (nonatomic, nullable) NSString *telemetryRequestId; | |||
@property (nonatomic, nullable) NSDictionary *appRequestMetadata; | |||
@property (nonatomic, readwrite) BOOL disableFRT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: readwrite is by default I think, can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
@interface MSIDFamilyRefreshToken : MSIDRefreshToken | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if not property, please consider removing the {}
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
- (instancetype)initWithRefreshToken:(MSIDRefreshToken *)refreshToken | ||
{ | ||
if (refreshToken && [refreshToken isKindOfClass:[MSIDRefreshToken class]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can we do the validation before passing into the init method? And also log the type of the token if type is not expected
- Please consider to remove duplicate code. e.g. if this is a subclass, maybe the credentialType is only needed?
@@ -149,6 +151,11 @@ - (void)showWebComponentWithCompletion:(MSIDWebviewAuthCompletionHandler)complet | |||
|
|||
} | |||
|
|||
- (void)updateCustomHeadersForFRTSupportIfNeeded | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit saw this pattern in code base:
NSAssert(NO, @"Abstract method.");
return;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
# Conflicts: # changelog.txt
… states: - On - Off - Ignore, keep as is
Proposed changes
Update the use of family refresh tokens, and instead use a single family refresh token.
Type of change
Risk
Additional information