Skip to content

Commit 25dd6b2

Browse files
authored
Merge pull request #985 from AzureAD/release/1.6.4
April release: common core release/1.6.4
2 parents c9f06a4 + f1a3491 commit 25dd6b2

File tree

57 files changed

+837
-176
lines changed

Some content is hidden

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

57 files changed

+837
-176
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@
553553
60F94D332210E8BD0035D956 /* MSIDV1IdToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 60F94D312210E8BD0035D956 /* MSIDV1IdToken.m */; };
554554
60FDA9C521A18D3F001E09B8 /* MSIDDefaultBrokerRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 60FDA9C421A18D3F001E09B8 /* MSIDDefaultBrokerRequestTests.m */; };
555555
60FDA9C721A19DA6001E09B8 /* MSIDDefaultBrokerResponseHandlerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 60FDA9C621A19DA6001E09B8 /* MSIDDefaultBrokerResponseHandlerTests.m */; };
556+
6599299D26296AA600830FD5 /* MSIDRequestTelemetryConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 6599299C26296AA600830FD5 /* MSIDRequestTelemetryConstants.h */; };
557+
659929AB26296B0200830FD5 /* MSIDRequestTelemetryConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 659929AA26296B0200830FD5 /* MSIDRequestTelemetryConstants.m */; };
558+
659929AC26296B0200830FD5 /* MSIDRequestTelemetryConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 659929AA26296B0200830FD5 /* MSIDRequestTelemetryConstants.m */; };
556559
6E4F658C24D488010070CA36 /* MSIDSymmetricKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4F658B24D488010070CA36 /* MSIDSymmetricKey.h */; };
557560
6E4F658E24D4883A0070CA36 /* MSIDSymmetricKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E4F658D24D4883A0070CA36 /* MSIDSymmetricKey.m */; };
558561
6E4F658F24D4883A0070CA36 /* MSIDSymmetricKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E4F658D24D4883A0070CA36 /* MSIDSymmetricKey.m */; };
@@ -2216,6 +2219,8 @@
22162219
60FDA9C621A19DA6001E09B8 /* MSIDDefaultBrokerResponseHandlerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDDefaultBrokerResponseHandlerTests.m; sourceTree = "<group>"; };
22172220
60FDA9D921A5EBBA001E09B8 /* MSIDTestCacheAccessorHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDTestCacheAccessorHelper.h; sourceTree = "<group>"; };
22182221
60FDA9DA21A5EBCF001E09B8 /* MSIDTestCacheAccessorHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDTestCacheAccessorHelper.m; sourceTree = "<group>"; };
2222+
6599299C26296AA600830FD5 /* MSIDRequestTelemetryConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDRequestTelemetryConstants.h; sourceTree = "<group>"; };
2223+
659929AA26296B0200830FD5 /* MSIDRequestTelemetryConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDRequestTelemetryConstants.m; sourceTree = "<group>"; };
22192224
6E4F658B24D488010070CA36 /* MSIDSymmetricKey.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDSymmetricKey.h; sourceTree = "<group>"; };
22202225
6E4F658D24D4883A0070CA36 /* MSIDSymmetricKey.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDSymmetricKey.m; sourceTree = "<group>"; };
22212226
6E4F659024D48B120070CA36 /* MSIDSymmetricKeyTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDSymmetricKeyTests.m; sourceTree = "<group>"; };
@@ -3411,6 +3416,8 @@
34113416
74F04D48246C8AC000094017 /* MSIDLastRequestTelemetrySerializedItem.m */,
34123417
74F04D4C246CB5B100094017 /* MSIDCurrentRequestTelemetrySerializedItem+Internal.h */,
34133418
74D926C224B3EFC300AA4270 /* MSIDLastRequestTelemetry+Internal.h */,
3419+
6599299C26296AA600830FD5 /* MSIDRequestTelemetryConstants.h */,
3420+
659929AA26296B0200830FD5 /* MSIDRequestTelemetryConstants.m */,
34143421
);
34153422
path = request_telemetry;
34163423
sourceTree = "<group>";
@@ -5356,6 +5363,7 @@
53565363
B286B9A72389DD2E007833AD /* MSIDAADOAuthEmbeddedWebviewController.h in Headers */,
53575364
58B81F8224AD0F8B00E8799E /* MSIDWebResponseBaseOperation.h in Headers */,
53585365
23B5DF76234030B2002C530F /* MSIDRequestParameters+Broker.h in Headers */,
5366+
6599299D26296AA600830FD5 /* MSIDRequestTelemetryConstants.h in Headers */,
53595367
239D72D423625EF40008C76A /* MSIDJsonSerializableFactory.h in Headers */,
53605368
23B5DF7D234031EE002C530F /* MSIDSSOExtensionSilentTokenRequestController.h in Headers */,
53615369
B227035422A3633700030ADC /* MSIDMaskedLogParameter.h in Headers */,
@@ -6565,6 +6573,7 @@
65656573
B2C707F52192524700D917B8 /* MSIDDefaultTokenRequestProvider.m in Sources */,
65666574
B8DBEF652395CA6100A16651 /* MSIDKeychainTokenCache.m in Sources */,
65676575
600D19BE20964D9E0004CD43 /* MSIDWorkPlaceJoinUtil.m in Sources */,
6576+
659929AC26296B0200830FD5 /* MSIDRequestTelemetryConstants.m in Sources */,
65686577
58B81F8424AD0F8B00E8799E /* MSIDWebResponseBaseOperation.m in Sources */,
65696578
B214C3A01FE854FE0070C4F2 /* MSIDLegacyTokenCacheAccessor.m in Sources */,
65706579
1E62D0E5228B75E3000E2BBC /* MSIDKeychainUtil.m in Sources */,
@@ -7000,6 +7009,7 @@
70007009
B28BDA85217E9676003E5670 /* MSIDB2CIdTokenClaims.m in Sources */,
70017010
B26CEAFF2367ACFA009E6E54 /* MSIDSFAuthenticationSessionHandler.m in Sources */,
70027011
B2AF1D27218BCD900080C1A0 /* MSIDBrokerInteractiveController.m in Sources */,
7012+
659929AB26296B0200830FD5 /* MSIDRequestTelemetryConstants.m in Sources */,
70037013
23B018A023554B2B00207FEC /* MSIDBrokerOperationTokenRequest.m in Sources */,
70047014
B210F4381FDDEA23005A8F76 /* MSIDAADV1TokenResponse.m in Sources */,
70057015
A0C7DE7525D465CD00F5B5B6 /* MSIDThrottlingModelBase.m in Sources */,

IdentityCore/src/IdentityCore.pch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#import <AppKit/AppKit.h>
3737
#endif
3838

39-
// Broker SDK relies on having ADAL_BROKER defined to 1.
39+
// Broker SDK relies on having AD_BROKER defined to 1.
4040
// This is defined in the ADAuthenticationBroker/Frameworks/aad_overrides.h file.
4141
// Without this, the build for Broker will not include this definition.
4242
#if __has_include("../../../../../aad_overrides.h")

IdentityCore/src/MSIDError.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
extern NSString *MSIDErrorDescriptionKey;
25-
extern NSString *MSIDOAuthErrorKey;
26-
extern NSString *MSIDOAuthSubErrorKey;
27-
extern NSString *MSIDCorrelationIdKey;
28-
extern NSString *MSIDHTTPHeadersKey;
29-
extern NSString *MSIDHTTPResponseCodeKey;
30-
extern NSString *MSIDUserDisplayableIdkey;
31-
extern NSString *MSIDHomeAccountIdkey;
32-
extern NSString *MSIDBrokerVersionKey;
24+
extern NSString * _Nonnull MSIDErrorDescriptionKey;
25+
extern NSString * _Nonnull MSIDOAuthErrorKey;
26+
extern NSString * _Nonnull MSIDOAuthSubErrorKey;
27+
extern NSString * _Nonnull MSIDCorrelationIdKey;
28+
extern NSString * _Nonnull MSIDHTTPHeadersKey;
29+
extern NSString * _Nonnull MSIDHTTPResponseCodeKey;
30+
extern NSString * _Nonnull MSIDUserDisplayableIdkey;
31+
extern NSString * _Nonnull MSIDHomeAccountIdkey;
32+
extern NSString * _Nonnull MSIDBrokerVersionKey;
3333

3434
/*!
3535
ADAL and MSID use different error domains and error codes.
@@ -38,10 +38,10 @@ extern NSString *MSIDBrokerVersionKey;
3838
domain mapping and error code mapping should be added to ADAuthenticationErrorConverter
3939
and MSIDErrorConveter in corresponding project.
4040
*/
41-
extern NSString *MSIDErrorDomain;
42-
extern NSString *MSIDOAuthErrorDomain;
43-
extern NSString *MSIDKeychainErrorDomain;
44-
extern NSString *MSIDHttpErrorCodeDomain;
41+
extern NSString * _Nonnull MSIDErrorDomain;
42+
extern NSString * _Nonnull MSIDOAuthErrorDomain;
43+
extern NSString * _Nonnull MSIDKeychainErrorDomain;
44+
extern NSString * _Nonnull MSIDHttpErrorCodeDomain;
4545

4646
/*!
4747
List of scopes that were requested from MSAL, but not granted in the response.
@@ -53,22 +53,22 @@ extern NSString *MSIDHttpErrorCodeDomain;
5353
* Requested scope is not supported for a particular account (Organizational scopes when it is a consumer account)
5454
5555
*/
56-
extern NSString *MSIDDeclinedScopesKey;
56+
extern NSString * _Nonnull MSIDDeclinedScopesKey;
5757

5858
/*!
5959
List of granted scopes in case some scopes weren't granted (see MSALDeclinedScopesKey for more info)
6060
*/
61-
extern NSString *MSIDGrantedScopesKey;
61+
extern NSString * _Nonnull MSIDGrantedScopesKey;
6262

6363
/*!
6464
This flag will be set if server is unavailable
6565
*/
66-
extern NSString *MSIDServerUnavailableStatusKey;
66+
extern NSString * _Nonnull MSIDServerUnavailableStatusKey;
6767

6868
/*!
6969
This flag will be set if we received a valid token response, but returned data mismatched.
7070
*/
71-
extern NSString *MSIDInvalidTokenResultKey;
71+
extern NSString * _Nonnull MSIDInvalidTokenResultKey;
7272

7373
/*!
7474
SSO extension failed with underlying error.
@@ -244,10 +244,10 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)
244244
MSIDErrorBrokerNotAvailable = -51814
245245
};
246246

247-
extern NSError *MSIDCreateError(NSString *domain, NSInteger code, NSString *errorDescription, NSString *oauthError, NSString *subError, NSError *underlyingError, NSUUID *correlationId, NSDictionary *additionalUserInfo, BOOL logErrorDescription);
247+
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);
248248

249-
extern MSIDErrorCode MSIDErrorCodeForOAuthError(NSString *oauthError, MSIDErrorCode defaultCode);
249+
extern MSIDErrorCode MSIDErrorCodeForOAuthError(NSString * _Nullable oauthError, MSIDErrorCode defaultCode);
250250

251-
extern NSDictionary<NSString *, NSArray *> *MSIDErrorDomainsAndCodes(void);
251+
extern NSDictionary<NSString *, NSArray *> * _Nonnull MSIDErrorDomainsAndCodes(void);
252252

253-
extern void MSIDFillAndLogError(NSError **error, MSIDErrorCode errorCode, NSString *errorDescription, NSUUID *correlationID);
253+
extern void MSIDFillAndLogError(NSError * _Nullable __autoreleasing * _Nullable error, MSIDErrorCode errorCode, NSString * _Nullable errorDescription, NSUUID * _Nullable correlationID);

IdentityCore/src/MSIDOAuth2Constants.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ extern NSString *const MSID_OAUTH2_ERROR;
3737
extern NSString *const MSID_OAUTH2_ERROR_DESCRIPTION;
3838
extern NSString *const MSID_OAUTH2_ERROR_SUBCODE;
3939
extern NSString *const MSID_OAUTH2_EXPIRES_IN;
40+
extern NSString *const MSID_OAUTH2_REFRESH_IN;
41+
extern NSString *const MSID_OAUTH2_REFRESH_ON;
4042
extern NSString *const MSID_OAUTH2_GRANT_TYPE;
4143
extern NSString *const MSID_OAUTH2_REDIRECT_URI;
4244
extern NSString *const MSID_OAUTH2_REFRESH_TOKEN;

IdentityCore/src/MSIDOAuth2Constants.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
NSString *const MSID_OAUTH2_REQUEST_ENDPOINT = @"endpointUrl";
7171

7272
NSString *const MSID_OAUTH2_EXPIRES_ON = @"expires_on";
73+
NSString *const MSID_OAUTH2_REFRESH_IN = @"refresh_in";
74+
NSString *const MSID_OAUTH2_REFRESH_ON = @"refresh_on";
7375
NSString *const MSID_OAUTH2_EXT_EXPIRES_IN = @"ext_expires_in";
7476
NSString *const MSID_FAMILY_ID = @"foci";
7577
NSString *const MSID_ENROLLMENT_ID = @"microsoft_enrollment_id";

IdentityCore/src/auth_scheme/MSIDAuthenticationScheme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
4343
@property (nonatomic, readonly) MSIDAuthScheme authScheme;
4444
@property (nonatomic, readonly) NSDictionary *schemeParameters;
4545
@property (nonatomic, readonly) MSIDCredentialType credentialType;
46-
@property (nonatomic, readonly) NSString *tokenType;
46+
@property (nonatomic, nullable, readonly) NSString *tokenType;
4747
@property (nonatomic, readonly) MSIDAccessToken *accessToken;
4848

4949
- (instancetype)initWithSchemeParameters:(NSDictionary *)schemeParameters;

IdentityCore/src/broker_operation/response/MSIDBrokerNativeAppOperationResponse.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
4040
@property (nonatomic) MSIDDeviceInfo *deviceInfo;
4141

4242
@property (nonatomic) NSNumber *httpStatusCode;
43+
@property (nonatomic, class, readonly) NSNumber *defaultHttpStatusCode;
4344
@property (nonatomic, nullable) NSDictionary *httpHeaders;
4445
@property (nonatomic) NSString *httpVersion;
4546

IdentityCore/src/broker_operation/response/MSIDBrokerNativeAppOperationResponse.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,16 @@ + (NSString *)responseType
6767

6868
- (NSNumber *)httpStatusCode
6969
{
70-
if (!_httpStatusCode) _httpStatusCode = @200;
70+
if (_httpStatusCode == nil) _httpStatusCode = self.class.defaultHttpStatusCode;
7171

7272
return _httpStatusCode;
7373
}
7474

75+
+ (NSNumber *)defaultHttpStatusCode
76+
{
77+
return @200;
78+
}
79+
7580
- (NSString *)httpVersion
7681
{
7782
if (!_httpVersion) _httpVersion = @"HTTP/1.1";

IdentityCore/src/cache/crypto/MSIDAssymetricKeyGenerating.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ NS_ASSUME_NONNULL_BEGIN
3030

3131
@protocol MSIDAssymetricKeyGenerating <NSObject>
3232

33-
- (MSIDAssymetricKeyPair *)generateKeyPairForAttributes:(MSIDAssymetricKeyLookupAttributes *)attributes
34-
error:(NSError **)error;
33+
- (nullable MSIDAssymetricKeyPair *)generateKeyPairForAttributes:(MSIDAssymetricKeyLookupAttributes *)attributes
34+
error:(NSError **)error;
3535

3636
- (MSIDAssymetricKeyPair *)readOrGenerateKeyPairForAttributes:(MSIDAssymetricKeyLookupAttributes *)attributes
3737
error:(NSError **)error;
3838

39-
- (MSIDAssymetricKeyPair *)readKeyPairForAttributes:(MSIDAssymetricKeyLookupAttributes *)attributes
39+
- (nullable MSIDAssymetricKeyPair *)readKeyPairForAttributes:(MSIDAssymetricKeyLookupAttributes *)attributes
4040
error:(NSError **)error;
4141

4242
- (MSIDAssymetricKeyPair *)generateEphemeralKeyPair:(NSError **)error;

IdentityCore/src/cache/crypto/MSIDAssymetricKeyKeychainGenerator.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ - (NSDictionary *)additionalPlatformKeychainAttributes
290290

291291
#pragma mark - Utils
292292

293-
- (void)logAndFillError:(NSString *)errorTitle status:(OSStatus)status error:(NSError **)error
293+
- (BOOL)logAndFillError:(NSString *)errorTitle status:(OSStatus)status error:(NSError **)error
294294
{
295295
NSString *description = [NSString stringWithFormat:@"Operation failed with title \"%@\", status %ld", errorTitle, (long)status];
296296
MSID_LOG_WITH_CTX(MSIDLogLevelError, nil, @"%@", description);
@@ -299,6 +299,8 @@ - (void)logAndFillError:(NSString *)errorTitle status:(OSStatus)status error:(NS
299299
{
300300
*error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, description, nil, nil, nil, nil, nil, NO);
301301
}
302+
303+
return YES;
302304
}
303305

304306
@end

0 commit comments

Comments
 (0)