Skip to content

Commit 4212aad

Browse files
authored
Merge pull request #538 from AzureAD/release/1.3.1
Merge 1.3.1 release into master
2 parents 68aa3f4 + 7111709 commit 4212aad

File tree

132 files changed

+3449
-560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+3449
-560
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 62 additions & 0 deletions
Large diffs are not rendered by default.

IdentityCore/src/MSIDConstants.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ extern NSString * _Nonnull const MSID_BROKER_RESUME_DICTIONARY_KEY;
8181
extern NSString * _Nonnull const MSID_BROKER_SYMMETRIC_KEY_TAG;
8282
extern NSString * _Nonnull const MSID_BROKER_ADAL_SCHEME;
8383
extern NSString * _Nonnull const MSID_BROKER_MSAL_SCHEME;
84+
extern NSString * _Nonnull const MSID_BROKER_NONCE_SCHEME;
8485
extern NSString * _Nonnull const MSID_BROKER_APP_BUNDLE_ID;
8586
extern NSString * _Nonnull const MSID_BROKER_APP_BUNDLE_ID_DF;
8687
extern NSString * _Nonnull const MSID_BROKER_MAX_PROTOCOL_VERSION;
@@ -92,6 +93,7 @@ extern NSString * _Nonnull const MSID_DEFAULT_FAMILY_ID;
9293
extern NSString * _Nonnull const MSID_ADAL_SDK_NAME;
9394
extern NSString * _Nonnull const MSID_MSAL_SDK_NAME;
9495
extern NSString * _Nonnull const MSID_SDK_NAME_KEY;
96+
extern NSString * _Nonnull const MSID_BROKER_APPLICATION_TOKEN_TAG;
9597

9698
extern NSString * _Nonnull const MSIDTrustedAuthority;
9799
extern NSString * _Nonnull const MSIDTrustedAuthorityUS;

IdentityCore/src/MSIDConstants.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
NSString *const MSID_BROKER_SYMMETRIC_KEY_TAG = @"com.microsoft.adBrokerKey\0";
3636
NSString *const MSID_BROKER_ADAL_SCHEME = @"msauth";
3737
NSString *const MSID_BROKER_MSAL_SCHEME = @"msauthv2";
38+
NSString *const MSID_BROKER_NONCE_SCHEME = @"msauthv3";
3839
NSString *const MSID_BROKER_APP_BUNDLE_ID = @"com.microsoft.azureauthenticator";
3940
NSString *const MSID_BROKER_APP_BUNDLE_ID_DF = @"com.microsoft.azureauthenticator-df";
4041
NSString *const MSID_BROKER_MAX_PROTOCOL_VERSION = @"max_protocol_ver";
@@ -46,6 +47,7 @@
4647
NSString *const MSID_ADAL_SDK_NAME = @"adal-objc";
4748
NSString *const MSID_MSAL_SDK_NAME = @"msal-objc";
4849
NSString *const MSID_SDK_NAME_KEY = @"sdk_name";
50+
NSString *const MSID_BROKER_APPLICATION_TOKEN_TAG = @"com.microsoft.adBrokerAppToken";
4951

5052

5153
NSString *const MSIDTrustedAuthority = @"login.windows.net";

IdentityCore/src/MSIDError.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)
228228

229229
// Unknown broker error returned
230230
MSIDErrorBrokerUnknown = -51811,
231+
232+
// Failed to save broker application token
233+
MSIDErrorBrokerApplicationTokenWriteFailed = -51812,
234+
235+
MSIDErrorBrokerApplicationTokenReadFailed = -51813
231236
};
232237

233238
extern NSError *MSIDCreateError(NSString *domain, NSInteger code, NSString *errorDescription, NSString *oauthError, NSString *subError, NSError *underlyingError, NSUUID *correlationId, NSDictionary *additionalUserInfo);

IdentityCore/src/MSIDError.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ MSIDErrorCode MSIDErrorCodeForOAuthError(NSString *oauthError, MSIDErrorCode def
127127
@(MSIDErrorBrokerKeyFailedToCreate),
128128
@(MSIDErrorBrokerKeyNotFound),
129129
@(MSIDErrorWorkplaceJoinRequired),
130-
@(MSIDErrorBrokerUnknown)
130+
@(MSIDErrorBrokerUnknown),
131+
@(MSIDErrorBrokerApplicationTokenWriteFailed),
132+
@(MSIDErrorBrokerApplicationTokenReadFailed),
131133

132134
],
133135
MSIDOAuthErrorDomain : @[// Server Errors

IdentityCore/src/MSIDNotifications.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
@property (class) NSString *webAuthDidReceiveResponseFromBrokerNotificationName;
5454

5555
#pragma mark - Notification callers
56-
+ (void)notifyWebAuthDidStartLoad:(NSURL *)url;
57-
+ (void)notifyWebAuthDidFinishLoad:(NSURL *)url;
56+
+ (void)notifyWebAuthDidStartLoad:(NSURL *)url userInfo:(NSDictionary *)userInfo;
57+
+ (void)notifyWebAuthDidFinishLoad:(NSURL *)url userInfo:(NSDictionary *)userInfo;
5858
+ (void)notifyWebAuthDidFailWithError:(NSError *)error;
5959
+ (void)notifyWebAuthDidCompleteWithURL:(NSURL *)url;
6060
+ (void)notifyWebAuthWillSwitchToBroker;

IdentityCore/src/MSIDNotifications.m

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,33 @@ + (void)setWebAuthDidReceiveResponseFromBrokerNotificationName:(NSString *)webAu
7171
+ (NSString *)webAuthDidReceiveResponseFromBrokerNotificationName { return s_webAuthDidReceiveResponseFromBrokerNotificationName; }
7272

7373
#pragma mark - Notifications
74-
+ (void)notifyWebAuthDidStartLoad:(NSURL *)url
74+
+ (void)notifyWebAuthDidStartLoad:(NSURL *)url userInfo:(NSDictionary *)userInfo
7575
{
7676
if (s_webAuthDidStartLoadNotificationName)
7777
{
78+
NSMutableDictionary *notificationInfo = [NSMutableDictionary new];
79+
[notificationInfo addEntriesFromDictionary:userInfo];
80+
81+
if (url) notificationInfo[@"url"] = url;
82+
7883
[[NSNotificationCenter defaultCenter] postNotificationName:s_webAuthDidStartLoadNotificationName
7984
object:nil
80-
userInfo:url ? @{ @"url" : url } : nil];
85+
userInfo:notificationInfo];
8186
}
8287
}
8388

84-
+ (void)notifyWebAuthDidFinishLoad:(NSURL *)url
89+
+ (void)notifyWebAuthDidFinishLoad:(NSURL *)url userInfo:(NSDictionary *)userInfo
8590
{
8691
if (s_webAuthDidFinishLoadNotificationName)
8792
{
93+
NSMutableDictionary *notificationInfo = [NSMutableDictionary new];
94+
[notificationInfo addEntriesFromDictionary:userInfo];
95+
96+
if (url) notificationInfo[@"url"] = url;
97+
8898
[[NSNotificationCenter defaultCenter] postNotificationName:s_webAuthDidFinishLoadNotificationName
8999
object:nil
90-
userInfo:url ? @{ @"url" : url } : nil];
100+
userInfo:notificationInfo];
91101
}
92102
}
93103

IdentityCore/src/MSIDOAuth2Constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ extern NSString *const MSID_SESSION_KEY_CACHE_KEY;
118118
extern NSString *const MSID_ACCOUNT_CACHE_KEY;
119119
extern NSString *const MSID_LAST_MOD_TIME_CACHE_KEY;
120120
extern NSString *const MSID_LAST_MOD_APP_CACHE_KEY;
121+
extern NSString *const MSID_APPLICATION_IDENTIFIER_CACHE_KEY;
121122

122123
extern NSString *const MSID_ACCESS_TOKEN_CACHE_TYPE;
123124
extern NSString *const MSID_ACCOUNT_CACHE_TYPE;

IdentityCore/src/MSIDOAuth2Constants.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
NSString *const MSID_ACCOUNT_CACHE_KEY = @"account_metadata";
121121
NSString *const MSID_LAST_MOD_TIME_CACHE_KEY = @"last_modification_time";
122122
NSString *const MSID_LAST_MOD_APP_CACHE_KEY = @"last_modification_app";
123-
123+
NSString *const MSID_APPLICATION_IDENTIFIER_CACHE_KEY = @"application_cache_identifier";
124124
NSString *const MSID_ACCESS_TOKEN_CACHE_TYPE = @"AccessToken";
125125
NSString *const MSID_ACCOUNT_CACHE_TYPE = @"Account";
126126
NSString *const MSID_REFRESH_TOKEN_CACHE_TYPE = @"RefreshToken";

IdentityCore/src/cache/accessor/MSIDAccountCredentialCache.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ - (BOOL)saveCredential:(nonnull MSIDCredentialCacheItem *)credential
230230
key.familyId = credential.familyId;
231231
key.realm = credential.realm;
232232
key.target = credential.target;
233-
key.enrollmentId = credential.enrollmentId;
233+
key.applicationIdentifier = credential.applicationIdentifier;
234234

235235
return [_dataSource saveToken:credential
236236
key:key
@@ -319,7 +319,7 @@ - (BOOL)removeCredential:(nonnull MSIDCredentialCacheItem *)credential
319319
key.familyId = credential.familyId;
320320
key.realm = credential.realm;
321321
key.target = credential.target;
322-
key.enrollmentId = credential.enrollmentId;
322+
key.applicationIdentifier = credential.applicationIdentifier;
323323
key.appKey = credential.appKey;
324324

325325
BOOL result = [_dataSource removeTokensWithKey:key context:context error:error];

0 commit comments

Comments
 (0)