Skip to content

Use single FRT [MSAL] #2550

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

Merged
merged 17 commits into from
Apr 23, 2025
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [TBD]
* Use a single family refresh token (#2550)

## [1.9.0]
* Add feature flags provider to be controlled from broker (#2540)
* Added GitHub issue templates for better issue tracking and reporting (#2554)
17 changes: 17 additions & 0 deletions MSAL/test/app/ios/MSALTestAppCacheViewController.m
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@
#import "MSALAccount+Internal.h"
#import "MSIDBaseToken.h"
#import "MSIDRefreshToken.h"
#import "MSIDFamilyRefreshToken.h"
#import "MSIDAccessToken.h"
#import "MSIDIdToken.h"
#import "MSIDLegacyTokenCacheAccessor.h"
@@ -163,6 +164,7 @@ - (void)deleteToken:(MSIDBaseToken *)token
{
switch (token.credentialType)
{
case MSIDFamilyRefreshTokenType:
case MSIDRefreshTokenType:
{
if ([token isKindOfClass:[MSIDLegacyRefreshToken class]])
@@ -469,6 +471,20 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}
break;
}
case MSIDFamilyRefreshTokenType:
{
MSIDFamilyRefreshToken *familyRefreshToken = (MSIDFamilyRefreshToken *) token;

cell.textLabel.text = [NSString stringWithFormat:@"FamilyRefreshToken : %@, FamilyId : %@", familyRefreshToken.clientId, familyRefreshToken.familyId ? familyRefreshToken.familyId : @"0"];
cell.detailTextLabel.text = [NSString stringWithFormat:@"Client_Id: %@", familyRefreshToken.clientId];

if ([familyRefreshToken.refreshToken isEqualToString:BAD_REFRESH_TOKEN])
{
cell.textLabel.textColor = [UIColor orangeColor];
cell.detailTextLabel.text = [NSString stringWithFormat:@"Client_Id : %@", familyRefreshToken.clientId];
}
break;
}
case MSIDAccessTokenType:
{
MSIDAccessToken *accessToken = (MSIDAccessToken *) token;
@@ -571,6 +587,7 @@ - (UISwipeActionsConfiguration *)tableView:(__unused UITableView *)tableView tra

switch (token.credentialType)
{
case MSIDFamilyRefreshTokenType:
case MSIDRefreshTokenType:
{
if ([token isKindOfClass:[MSIDLegacyRefreshToken class]])
16 changes: 16 additions & 0 deletions MSAL/test/app/mac/MSALCacheViewController.m
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
#import "MSIDAccountIdentifier.h"
#import "MSIDBaseToken.h"
#import "MSIDRefreshToken.h"
#import "MSIDFamilyRefreshToken.h"
#import "MSIDAccessToken.h"
#import "MSIDIdToken.h"
#import "MSIDKeychainTokenCache.h"
@@ -234,6 +235,7 @@ - (void)deleteToken:(MSIDBaseToken *)token
{
switch (token.credentialType)
{
case MSIDFamilyRefreshTokenType:
case MSIDRefreshTokenType:
{
[self.defaultAccessor validateAndRemoveRefreshToken:(MSIDRefreshToken *)token
@@ -365,6 +367,20 @@ - (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTable
MSIDBaseToken *token = (MSIDBaseToken *)item;
switch (token.credentialType)
{
case MSIDFamilyRefreshTokenType:
{
MSIDFamilyRefreshToken *familyRefreshToken = (MSIDFamilyRefreshToken *)token;
textValue = [NSString stringWithFormat:@"Family Refresh Token: ClientId - %@, Realm - %@, FamilyId - %@", familyRefreshToken.clientId, familyRefreshToken.realm, familyRefreshToken.familyId];

if ([familyRefreshToken.refreshToken isEqualToString:s_badRefreshToken])
{
cellView.textField.textColor = [NSColor redColor];
[cellView.textField setStringValue:textValue];
return cellView;
}

break;
}
case MSIDRefreshTokenType:
{
MSIDRefreshToken *refreshToken = (MSIDRefreshToken *) token;