Skip to content

Commit 50dc64d

Browse files
authored
Merge pull request #1014 from AzureAD/release/1.6.7
Release/1.6.7
2 parents 3b6eae2 + c70d010 commit 50dc64d

33 files changed

+343
-125
lines changed

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@
683683
96F94A3B208184790034676C /* MSIDOAuth2EmbeddedWebviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F94A38208184790034676C /* MSIDOAuth2EmbeddedWebviewController.m */; };
684684
A0410E0825E81C5D004D80FD /* MSIDThrottlingModel429Test.m in Sources */ = {isa = PBXBuildFile; fileRef = A0410E0725E81C5D004D80FD /* MSIDThrottlingModel429Test.m */; };
685685
A0410E0925E81C5D004D80FD /* MSIDThrottlingModel429Test.m in Sources */ = {isa = PBXBuildFile; fileRef = A0410E0725E81C5D004D80FD /* MSIDThrottlingModel429Test.m */; };
686-
A0410E1A25E87E1A004D80FD /* MSIDThrottlingModelInteractionRequireTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A0410E1925E87E1A004D80FD /* MSIDThrottlingModelInteractionRequireTest.m */; };
687-
A0410E1B25E87E1A004D80FD /* MSIDThrottlingModelInteractionRequireTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A0410E1925E87E1A004D80FD /* MSIDThrottlingModelInteractionRequireTest.m */; };
686+
A0410E1A25E87E1A004D80FD /* MSIDThrottlingModelNonRecoverableServerError.m in Sources */ = {isa = PBXBuildFile; fileRef = A0410E1925E87E1A004D80FD /* MSIDThrottlingModelNonRecoverableServerError.m */; };
687+
A0410E1B25E87E1A004D80FD /* MSIDThrottlingModelNonRecoverableServerError.m in Sources */ = {isa = PBXBuildFile; fileRef = A0410E1925E87E1A004D80FD /* MSIDThrottlingModelNonRecoverableServerError.m */; };
688688
A0410E5025E88B5E004D80FD /* MSIDThrottlingMetaDataTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A0410E4F25E88B5E004D80FD /* MSIDThrottlingMetaDataTest.m */; };
689689
A0410E5125E88B5E004D80FD /* MSIDThrottlingMetaDataTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A0410E4F25E88B5E004D80FD /* MSIDThrottlingMetaDataTest.m */; };
690690
A057456225A669B90098E469 /* MSIDThrottlingCacheRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = E7B67215257EA84B0053773F /* MSIDThrottlingCacheRecord.h */; };
@@ -707,8 +707,8 @@
707707
A0C7DE8525D46D7000F5B5B6 /* MSIDThrottlingModelFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C7DE8325D46D7000F5B5B6 /* MSIDThrottlingModelFactory.m */; };
708708
A0C7DEC325D4C8B600F5B5B6 /* MSIDThrottlingModel429.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C7DEC225D4C8B600F5B5B6 /* MSIDThrottlingModel429.m */; };
709709
A0C7DEC425D4C8B600F5B5B6 /* MSIDThrottlingModel429.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C7DEC225D4C8B600F5B5B6 /* MSIDThrottlingModel429.m */; };
710-
A0C7DED225D4CB2800F5B5B6 /* MSIDThrottlingModelInteractionRequire.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C7DED125D4CB2800F5B5B6 /* MSIDThrottlingModelInteractionRequire.m */; };
711-
A0C7DED325D4CB2800F5B5B6 /* MSIDThrottlingModelInteractionRequire.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C7DED125D4CB2800F5B5B6 /* MSIDThrottlingModelInteractionRequire.m */; };
710+
A0C7DED225D4CB2800F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C7DED125D4CB2800F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.m */; };
711+
A0C7DED325D4CB2800F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.m in Sources */ = {isa = PBXBuildFile; fileRef = A0C7DED125D4CB2800F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.m */; };
712712
A0E540BD25CB62270016E167 /* MSIDThrottlingService.m in Sources */ = {isa = PBXBuildFile; fileRef = A057458325A789DC0098E469 /* MSIDThrottlingService.m */; };
713713
A0E5419625CDC44B0016E167 /* MSIDThrottlingMetaData.h in Headers */ = {isa = PBXBuildFile; fileRef = A0E5419525CDC44B0016E167 /* MSIDThrottlingMetaData.h */; };
714714
A0E541B025CDC5F10016E167 /* MSIDThrottlingMetaData.m in Sources */ = {isa = PBXBuildFile; fileRef = A0E541AF25CDC5F10016E167 /* MSIDThrottlingMetaData.m */; };
@@ -2327,7 +2327,7 @@
23272327
96F94A37208184790034676C /* MSIDOAuth2EmbeddedWebviewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDOAuth2EmbeddedWebviewController.h; sourceTree = "<group>"; };
23282328
96F94A38208184790034676C /* MSIDOAuth2EmbeddedWebviewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDOAuth2EmbeddedWebviewController.m; sourceTree = "<group>"; };
23292329
A0410E0725E81C5D004D80FD /* MSIDThrottlingModel429Test.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MSIDThrottlingModel429Test.m; path = throttling/MSIDThrottlingModel429Test.m; sourceTree = "<group>"; };
2330-
A0410E1925E87E1A004D80FD /* MSIDThrottlingModelInteractionRequireTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MSIDThrottlingModelInteractionRequireTest.m; path = throttling/MSIDThrottlingModelInteractionRequireTest.m; sourceTree = "<group>"; };
2330+
A0410E1925E87E1A004D80FD /* MSIDThrottlingModelNonRecoverableServerError.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MSIDThrottlingModelNonRecoverableServerError.m; path = throttling/MSIDThrottlingModelNonRecoverableServerError.m; sourceTree = "<group>"; };
23312331
A0410E4F25E88B5E004D80FD /* MSIDThrottlingMetaDataTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MSIDThrottlingMetaDataTest.m; path = throttling/MSIDThrottlingMetaDataTest.m; sourceTree = "<group>"; };
23322332
A057458325A789DC0098E469 /* MSIDThrottlingService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDThrottlingService.m; sourceTree = "<group>"; };
23332333
A07EB426259D0BF300783943 /* MSIDThrottlingService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDThrottlingService.h; sourceTree = "<group>"; };
@@ -2349,11 +2349,11 @@
23492349
A0C7DE3425D451DF00F5B5B6 /* MSIDThrottlingModelBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDThrottlingModelBase.h; sourceTree = "<group>"; };
23502350
A0C7DE4325D4522300F5B5B6 /* MSIDThrottlingModelFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDThrottlingModelFactory.h; sourceTree = "<group>"; };
23512351
A0C7DE5D25D4523800F5B5B6 /* MSIDThrottlingModel429.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDThrottlingModel429.h; sourceTree = "<group>"; };
2352-
A0C7DE5E25D4524D00F5B5B6 /* MSIDThrottlingModelInteractionRequire.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDThrottlingModelInteractionRequire.h; sourceTree = "<group>"; };
2352+
A0C7DE5E25D4524D00F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDThrottlingModelNonRecoverableServerError.h; sourceTree = "<group>"; };
23532353
A0C7DE7425D465CD00F5B5B6 /* MSIDThrottlingModelBase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDThrottlingModelBase.m; sourceTree = "<group>"; };
23542354
A0C7DE8325D46D7000F5B5B6 /* MSIDThrottlingModelFactory.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDThrottlingModelFactory.m; sourceTree = "<group>"; };
23552355
A0C7DEC225D4C8B600F5B5B6 /* MSIDThrottlingModel429.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDThrottlingModel429.m; sourceTree = "<group>"; };
2356-
A0C7DED125D4CB2800F5B5B6 /* MSIDThrottlingModelInteractionRequire.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDThrottlingModelInteractionRequire.m; sourceTree = "<group>"; };
2356+
A0C7DED125D4CB2800F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDThrottlingModelNonRecoverableServerError.m; sourceTree = "<group>"; };
23572357
A0E5419525CDC44B0016E167 /* MSIDThrottlingMetaData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDThrottlingMetaData.h; sourceTree = "<group>"; };
23582358
A0E541AF25CDC5F10016E167 /* MSIDThrottlingMetaData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDThrottlingMetaData.m; sourceTree = "<group>"; };
23592359
A0E541D325CDDAB30016E167 /* MSIDThrottlingMetaDataCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDThrottlingMetaDataCache.h; sourceTree = "<group>"; };
@@ -3873,8 +3873,8 @@
38733873
A0C7DE8325D46D7000F5B5B6 /* MSIDThrottlingModelFactory.m */,
38743874
A0C7DE5D25D4523800F5B5B6 /* MSIDThrottlingModel429.h */,
38753875
A0C7DEC225D4C8B600F5B5B6 /* MSIDThrottlingModel429.m */,
3876-
A0C7DE5E25D4524D00F5B5B6 /* MSIDThrottlingModelInteractionRequire.h */,
3877-
A0C7DED125D4CB2800F5B5B6 /* MSIDThrottlingModelInteractionRequire.m */,
3876+
A0C7DE5E25D4524D00F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.h */,
3877+
A0C7DED125D4CB2800F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.m */,
38783878
);
38793879
path = model;
38803880
sourceTree = "<group>";
@@ -4965,7 +4965,7 @@
49654965
isa = PBXGroup;
49664966
children = (
49674967
A0410E4F25E88B5E004D80FD /* MSIDThrottlingMetaDataTest.m */,
4968-
A0410E1925E87E1A004D80FD /* MSIDThrottlingModelInteractionRequireTest.m */,
4968+
A0410E1925E87E1A004D80FD /* MSIDThrottlingModelNonRecoverableServerError.m */,
49694969
A0410E0725E81C5D004D80FD /* MSIDThrottlingModel429Test.m */,
49704970
A08D0A4724A8841400C9193D /* MSIDAuthenticationSchemeTest.m */,
49714971
A08D09DF24A85A1D00C9193D /* MSIDAADRefreshTokenGrantRequestTest.m */,
@@ -6300,7 +6300,7 @@
63006300
B27893732470BA5B00627C28 /* MSIDAssymetricKeychainGeneratorTests.m in Sources */,
63016301
23B3A4552187BA79009070B2 /* MSIDIntuneEnrollmentIdsCacheTests.m in Sources */,
63026302
B2936F7420ABEFC10050C585 /* MSIDAccessTokenTests.m in Sources */,
6303-
A0410E1A25E87E1A004D80FD /* MSIDThrottlingModelInteractionRequireTest.m in Sources */,
6303+
A0410E1A25E87E1A004D80FD /* MSIDThrottlingModelNonRecoverableServerError.m in Sources */,
63046304
B20657CF1FC92B8F00412B7D /* MSIDTelemetryUIEventTests.m in Sources */,
63056305
232C657621376755002A41FE /* MSIDDRSDiscoveryResponseSerializerTests.m in Sources */,
63066306
23419F5D23973AAD00EA78C5 /* MSIDBrokerOperationRequestTests.m in Sources */,
@@ -6629,7 +6629,7 @@
66296629
96C998F120B638F60053A2D9 /* MSIDWebviewSession.m in Sources */,
66306630
96891A982190F15E00D7F437 /* MSIDWPJChallengeHandler.m in Sources */,
66316631
B26CEADB23652795009E6E54 /* MSIDMacACLKeychainAccessor.m in Sources */,
6632-
A0C7DED325D4CB2800F5B5B6 /* MSIDThrottlingModelInteractionRequire.m in Sources */,
6632+
A0C7DED325D4CB2800F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.m in Sources */,
66336633
96090D9A20E59B2000E42B37 /* MSIDNotifications.m in Sources */,
66346634
23D2049521D1C274009B5975 /* MSIDTokenResponseSerializer.m in Sources */,
66356635
96F94A2920816B870034676C /* MSIDWebOAuth2AuthCodeResponse.m in Sources */,
@@ -6728,7 +6728,7 @@
67286728
A0410E0925E81C5D004D80FD /* MSIDThrottlingModel429Test.m in Sources */,
67296729
B2DD4B2F20A8D7DE0047A66E /* MSIDCacheKeyTests.m in Sources */,
67306730
B2DD5B7B20461F5E0084313F /* MSIDAccountCacheItemTests.m in Sources */,
6731-
A0410E1B25E87E1A004D80FD /* MSIDThrottlingModelInteractionRequireTest.m in Sources */,
6731+
A0410E1B25E87E1A004D80FD /* MSIDThrottlingModelNonRecoverableServerError.m in Sources */,
67326732
606B108C20D084B600B34224 /* MSIDAADV1WebviewFactoryTests.m in Sources */,
67336733
96CD652A20C885E2004813EE /* MSIDWebviewFactoryTests.m in Sources */,
67346734
239DF9C220E04BC9002D428B /* MSIDB2CAuthorityTests.m in Sources */,
@@ -7144,7 +7144,7 @@
71447144
B20657BE1FC9254800412B7D /* MSIDTelemetryCacheEvent.m in Sources */,
71457145
58B81F7D24AD0E7A00E8799E /* MSIDWebResponseOperationFactory.m in Sources */,
71467146
E70C49F1258D662F00A7A07E /* MSIDLRUCache.m in Sources */,
7147-
A0C7DED225D4CB2800F5B5B6 /* MSIDThrottlingModelInteractionRequire.m in Sources */,
7147+
A0C7DED225D4CB2800F5B5B6 /* MSIDThrottlingModelNonRecoverableServerError.m in Sources */,
71487148
A0E541EE25CDDAFD0016E167 /* MSIDThrottlingMetaDataCache.m in Sources */,
71497149
96F94A3A208184790034676C /* MSIDOAuth2EmbeddedWebviewController.m in Sources */,
71507150
B2E2A93E2392F91100BA2EA3 /* MSIDInteractiveTokenRequestParameters.m in Sources */,

IdentityCore/src/MSIDBrokerConstants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ extern NSString * _Nonnull const MSID_MSAL_BROKER_MESSAGE_VERSION;
7575
extern NSString * _Nonnull const MSID_BROKER_SDK_CAPABILITIES_KEY;
7676
extern NSString * _Nonnull const MSID_BROKER_SDK_SSO_EXTENSION_CAPABILITY;
7777
extern NSString * _Nonnull const MSID_ADDITIONAL_EXTENSION_DATA_KEY;
78-
78+
extern NSString * _Nonnull const MSID_SSO_NONCE_QUERY_PARAM_KEY;

IdentityCore/src/MSIDBrokerConstants.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@
7171
NSString *const MSID_BROKER_SDK_SSO_EXTENSION_CAPABILITY = @"sso_extension";
7272

7373
NSString *const MSID_ADDITIONAL_EXTENSION_DATA_KEY = @"additional_extension_data";
74+
NSString *const MSID_SSO_NONCE_QUERY_PARAM_KEY = @"sso_nonce";

IdentityCore/src/MSIDError.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,12 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)
241241

242242
MSIDErrorBrokerApplicationTokenReadFailed = -51813,
243243

244-
MSIDErrorBrokerNotAvailable = -51814
244+
MSIDErrorBrokerNotAvailable = -51814,
245+
246+
// Throttling errors
247+
MSIDErrorThrottleCacheNoRecord = -51900,
248+
MSIDErrorThrottleCacheInvalidSignature = -51901,
249+
245250
};
246251

247252
extern NSError * _Nonnull MSIDCreateError(NSString * _Nonnull domain, NSInteger code, NSString * _Nullable errorDescription, NSString * _Nullable oauthError, NSString * _Nullable subError, NSError * _Nullable underlyingError, NSUUID * _Nullable correlationId, NSDictionary * _Nullable additionalUserInfo, BOOL logErrorDescription);

IdentityCore/src/cache/key/MSIDDefaultAccountCacheQuery.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525

2626
@implementation MSIDDefaultAccountCacheQuery
2727

28-
- (NSString *)account
28+
- (id)init
2929
{
30-
if (self.homeAccountId && self.environment)
30+
self = [super init];
31+
if (self != nil)
3132
{
32-
return [super account];
33+
self.accountType = MSIDAccountTypeMSSTS;
3334
}
34-
35-
return nil;
35+
return self;
3636
}
3737

38-
- (NSNumber *)type
38+
- (NSString *)account
3939
{
40-
if (self.accountType != MSIDAccountTypeOther)
40+
if (self.homeAccountId && self.environment)
4141
{
42-
return [super type];
42+
return [super account];
4343
}
4444

4545
return nil;

IdentityCore/src/controllers/MSIDLocalInteractiveController.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ - (void)acquireToken:(MSIDRequestCompletionBlock)completionBlock
7878

7979
MSIDRequestCompletionBlock completionBlockWrapper = ^(MSIDTokenResult * _Nullable result, NSError * _Nullable error)
8080
{
81-
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, self.requestParameters, @"Interactive flow finished. Result %@, error: %ld error domain: %@", _PII_NULLIFY(result), (long)error.code, error.domain);
81+
NSString *ssoNonce = [error.userInfo valueForKey:MSID_SSO_NONCE_QUERY_PARAM_KEY];
82+
if ([NSString msidIsStringNilOrBlank:ssoNonce])
83+
{
84+
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, self.requestParameters, @"Interactive flow finished. Result %@, error: %ld error domain: %@", _PII_NULLIFY(result), (long)error.code, error.domain);
85+
}
8286
if (!error)
8387
{
8488
/**

IdentityCore/src/controllers/broker/ios/MSIDBrokerInteractiveController.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#import "MSIDBrokerInvocationOptions.h"
4343
#import "MSIDBrokerKeyProvider.h"
4444
#import "MSIDMainThreadUtil.h"
45+
#import "NSString+MSIDExtensions.h"
4546

4647
static MSIDBrokerInteractiveController *s_currentExecutingController;
4748

@@ -287,8 +288,8 @@ + (BOOL)completeAcquireToken:(nullable NSURL *)resultURL
287288
sourceApplication:(nullable NSString *)sourceApplication
288289
brokerResponseHandler:(nonnull MSIDBrokerResponseHandler *)responseHandler
289290
{
290-
// sourceApplication could be nil, we want to return early if we know for sure response is not from broker
291-
if (sourceApplication && ![self isResponseFromBroker:sourceApplication])
291+
// sourceApplication could be nil or empty, we want to return early if we know for sure response is not from broker
292+
if (![NSString msidIsStringNilOrBlank:sourceApplication] && ![self isResponseFromBroker:sourceApplication])
292293
{
293294
MSID_LOG_WITH_CTX(MSIDLogLevelWarning,nil, @"Asked to handle non broker response. Skipping request.");
294295
return NO;

IdentityCore/src/oauth2/aad_base/MSIDAADWebviewFactory.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ - (MSIDWebviewResponse *)oAuthResponseWithURL:(NSURL *)url
123123
#if AD_BROKER
124124
MSIDCBAWebAADAuthResponse *cbaResponse = [[MSIDCBAWebAADAuthResponse alloc] initWithURL:url context:context error:nil];
125125
if (cbaResponse) return cbaResponse;
126+
127+
if ([url.absoluteString containsString:[NSString stringWithFormat:@"%@=", MSID_SSO_NONCE_QUERY_PARAM_KEY]])
128+
{
129+
NSString *ssoNonce = [[url msidQueryParameters] valueForKey:MSID_SSO_NONCE_QUERY_PARAM_KEY];
130+
if (![NSString msidIsStringNilOrBlank:ssoNonce] && error)
131+
{
132+
NSDictionary *userInfo = @{MSID_SSO_NONCE_QUERY_PARAM_KEY : ssoNonce};
133+
*error = MSIDCreateError(MSIDErrorDomain, MSIDErrorAuthorizationFailed, @"Nonce in JWT headers is likely expired, received SSO nonce redirect response.", nil, nil, nil, context.correlationId, userInfo, NO);
134+
return nil;
135+
}
136+
}
126137
#endif
127138

128139
// Try to create a WPJ response

IdentityCore/src/oauth2/token/MSIDPrimaryRefreshToken.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#import "MSIDAuthority.h"
3030

3131
static NSUInteger kDefaultPRTRefreshInterval = 10800;
32+
static NSString *kMinSupportedPRTVersion = @"3.0";
3233

3334
@implementation MSIDPrimaryRefreshToken
3435

@@ -51,6 +52,13 @@ - (instancetype)initWithTokenCacheItem:(MSIDCredentialCacheItem *)tokenCacheItem
5152
}
5253

5354
_prtProtocolVersion = [jsonDictionary msidObjectForKey:MSID_PRT_PROTOCOL_VERSION_CACHE_KEY ofClass:[NSString class]];
55+
56+
if ([_prtProtocolVersion floatValue] < [kMinSupportedPRTVersion floatValue])
57+
{
58+
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, nil, @"Upgrading PRT from version %@ to min required version %@", _prtProtocolVersion, kMinSupportedPRTVersion);
59+
_prtProtocolVersion = kMinSupportedPRTVersion;
60+
}
61+
5462
_expiresOn = tokenCacheItem.expiresOn;
5563
_cachedAt = tokenCacheItem.cachedAt;
5664
_expiryInterval = [tokenCacheItem.expiryInterval integerValue];

0 commit comments

Comments
 (0)