Skip to content

Commit d716f63

Browse files
authored
Merge branch 'dev' into ameyapat/bound-refresh-token-object
2 parents 5f0466d + 8d78d3c commit d716f63

19 files changed

+290
-20
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,9 @@
741741
728209D026FEA0F600B5F018 /* MSIDKeyOperationUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 728209CF26FEA0F600B5F018 /* MSIDKeyOperationUtil.m */; };
742742
728209D126FEA0F600B5F018 /* MSIDKeyOperationUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 728209CF26FEA0F600B5F018 /* MSIDKeyOperationUtil.m */; };
743743
728209D62702AF8900B5F018 /* MSIDBackgroundTaskManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 728209D32702AE9300B5F018 /* MSIDBackgroundTaskManagerTests.m */; };
744+
728ABACC2E5A3B4E00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 728ABACB2E5A3B2800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h */; };
745+
728ABACE2E5A41A800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 728ABACD2E5A418F00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m */; };
746+
728ABACF2E5A41A800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 728ABACD2E5A418F00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m */; };
744747
728D9E4628245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 728D9E4528245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m */; };
745748
728D9E4728245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 728D9E4528245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m */; };
746749
728D9E492824A323001D990F /* MSIDPkeyAuthHelperTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CA0C5E220A68D400768729 /* MSIDPkeyAuthHelperTests.m */; };
@@ -2662,6 +2665,8 @@
26622665
728209CD26FEA0D800B5F018 /* MSIDKeyOperationUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDKeyOperationUtil.h; sourceTree = "<group>"; };
26632666
728209CF26FEA0F600B5F018 /* MSIDKeyOperationUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDKeyOperationUtil.m; sourceTree = "<group>"; };
26642667
728209D32702AE9300B5F018 /* MSIDBackgroundTaskManagerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDBackgroundTaskManagerTests.m; sourceTree = "<group>"; };
2668+
728ABACB2E5A3B2800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MSIDWPJKeyPairWithCert+TransportKey.h"; sourceTree = "<group>"; };
2669+
728ABACD2E5A418F00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "MSIDWPJKeyPairWithCert+TransportKey.m"; sourceTree = "<group>"; };
26652670
728D9E4528245DD7001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDTestSecureEnclaveKeyPairGenerator.m; sourceTree = "<group>"; };
26662671
728D9E4828247D4C001D990F /* MSIDTestSecureEnclaveKeyPairGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDTestSecureEnclaveKeyPairGenerator.h; sourceTree = "<group>"; };
26672672
729357E72DD810C70001D03C /* MSIDNonceTokenRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDNonceTokenRequest.h; sourceTree = "<group>"; };
@@ -5188,6 +5193,8 @@
51885193
B2C0747E246B70DC0008D701 /* crypto */ = {
51895194
isa = PBXGroup;
51905195
children = (
5196+
728ABACD2E5A418F00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m */,
5197+
728ABACB2E5A3B2800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h */,
51915198
B27893792470CAF200627C28 /* mac */,
51925199
B2C0748E246B71470008D701 /* MSIDAssymetricKeyGenerating.h */,
51935200
B2C07490246B735B0008D701 /* MSIDAssymetricKeyKeychainGenerator.h */,
@@ -6149,6 +6156,7 @@
61496156
A07EB427259D0C6B00783943 /* MSIDThrottlingService.h in Headers */,
61506157
9658103120C7E1180025F4A4 /* MSIDWebviewResponse.h in Headers */,
61516158
1E707FDF2407335700716148 /* MSIDBrokerNativeAppOperationResponse.h in Headers */,
6159+
728ABACC2E5A3B4E00FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.h in Headers */,
61526160
B28BDA7F217E964B003E5670 /* MSIDB2CTokenResponse.h in Headers */,
61536161
96B8D57D20946D2600E3F4A6 /* MSIDPkce.h in Headers */,
61546162
B286B9912389DC47007833AD /* MSIDIndividualClaimRequest.h in Headers */,
@@ -7400,6 +7408,7 @@
74007408
23C8981A2C892A3800071482 /* MSIDBrowserNativeMessageGetSupportedContractsResponse.m in Sources */,
74017409
B286B9992389DC9D007833AD /* MSIDSSOExtensionSilentTokenRequest.m in Sources */,
74027410
B2C7089921991D0000D917B8 /* MSIDAADV2BrokerResponse.m in Sources */,
7411+
728ABACE2E5A41A800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m in Sources */,
74037412
B20E3CB61FC4FE400029C097 /* MSIDOAuth2Constants.m in Sources */,
74047413
B2BE924D21A2331A00F5AB8C /* MSIDTelemetryAuthorityValidationEvent.m in Sources */,
74057414
B2807FF9204CAFDF00944D89 /* MSIDHelpers.m in Sources */,
@@ -8107,6 +8116,7 @@
81078116
239E3BBF23E1004F00F7A50A /* MSIDClientSDKType.m in Sources */,
81088117
23B39ABD209BD47D000AA905 /* MSIDB2CAuthorityResolver.m in Sources */,
81098118
B2F671E92467A34400649855 /* MSIDAuthorizationCodeResult.m in Sources */,
8119+
728ABACF2E5A41A800FCE434 /* MSIDWPJKeyPairWithCert+TransportKey.m in Sources */,
81108120
23C10A9F2B40D9350063D97C /* MSIDBrowserNativeMessageSignOutResponse.m in Sources */,
81118121
23FB5C2B225517AA002BF1EB /* MSIDIndividualClaimRequestAdditionalInfo.m in Sources */,
81128122
1E707FDD2406FA9200716148 /* MSIDBrokerBrowserOperationResponse.m in Sources */,

IdentityCore/src/broker_operation/request/browser_native_message_request/MSIDBrokerOperationBrowserNativeMessageRequest.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ + (NSString *)operation
6161

6262
- (NSString *)callerBundleIdentifier
6363
{
64-
return self.parentProcessBundleIdentifier ?: NSLocalizedString(@"N/A", nil);
64+
return self.parentProcessBundleIdentifier ?: @"";
6565
}
6666

6767
- (NSString *)callerTeamIdentifier
6868
{
69-
return self.parentProcessTeamId ?: NSLocalizedString(@"N/A", nil);
69+
return self.parentProcessTeamId ?: @"";
7070
}
7171

7272
- (NSString *)localizedCallerDisplayName
7373
{
74-
return self.parentProcessLocalizedName ?: NSLocalizedString(@"N/A", nil);
74+
return self.parentProcessLocalizedName ?: @"";
7575
}
7676

7777
- (NSString *)localizedApplicationInfo
@@ -87,7 +87,7 @@ - (NSString *)localizedApplicationInfo
8787
return brokerOperationRequest.localizedApplicationInfo;
8888
}
8989

90-
return NSLocalizedString(@"N/A", nil);
90+
return @"";
9191
}
9292

9393
#pragma mark - MSIDJsonSerializable

IdentityCore/src/broker_operation/request/token_request/MSIDBrokerOperationTokenRequest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN
5050
@property (nonatomic) BOOL skipValidateResultAccount;
5151
@property (nonatomic) BOOL forceRefresh;
5252
@property (nonatomic) BOOL ignoreScopeValidation;
53-
53+
@property (nonatomic) BOOL bypassRedirectURIValidation;
5454

5555
+ (BOOL)fillRequest:(MSIDBrokerOperationTokenRequest *)request
5656
withParameters:(MSIDRequestParameters *)parameters

IdentityCore/src/broker_operation/request/token_request/MSIDBrokerOperationTokenRequest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ + (BOOL)fillRequest:(MSIDBrokerOperationTokenRequest *)request
6868
request.platformSequence = parameters.platformSequence;
6969
request.allowAnyExtraURLQueryParameters = parameters.allowAnyExtraURLQueryParameters;
7070
request.ignoreScopeValidation = parameters.ignoreScopeValidation;
71+
request.bypassRedirectURIValidation = parameters.bypassRedirectURIValidation;
7172
return YES;
7273
}
7374

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// Copyright (c) Microsoft Corporation.
3+
// All rights reserved.
4+
//
5+
// This code is licensed under the MIT License.
6+
//
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy
8+
// of this software and associated documentation files(the "Software"), to deal
9+
// in the Software without restriction, including without limitation the rights
10+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
11+
// copies of the Software, and to permit persons to whom the Software is
12+
// furnished to do so, subject to the following conditions :
13+
//
14+
// The above copyright notice and this permission notice shall be included in
15+
// all copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
// THE SOFTWARE.
24+
25+
#import <Foundation/Foundation.h>
26+
27+
NS_ASSUME_NONNULL_BEGIN
28+
@interface MSIDWPJKeyPairWithCert (TransportKey)
29+
30+
@property (nonatomic) SecKeyRef privateTransportKeyRef;
31+
32+
@end
33+
NS_ASSUME_NONNULL_END
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//
2+
// Copyright (c) Microsoft Corporation.
3+
// All rights reserved.
4+
//
5+
// This code is licensed under the MIT License.
6+
//
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy
8+
// of this software and associated documentation files(the "Software"), to deal
9+
// in the Software without restriction, including without limitation the rights
10+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
11+
// copies of the Software, and to permit persons to whom the Software is
12+
// furnished to do so, subject to the following conditions :
13+
//
14+
// The above copyright notice and this permission notice shall be included in
15+
// all copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
// THE SOFTWARE.
24+
25+
#import "MSIDWPJKeyPairWithCert.h"
26+
#import "MSIDWPJKeyPairWithCert+TransportKey.h"
27+
28+
@implementation MSIDWPJKeyPairWithCert (TransportKey)
29+
30+
- (void)setPrivateTransportKeyRef:(SecKeyRef)privateTransportKeyRef
31+
{
32+
if (_privateTransportKeyRef != privateTransportKeyRef)
33+
{
34+
if (_privateTransportKeyRef)
35+
{
36+
CFRelease(_privateTransportKeyRef);
37+
_privateTransportKeyRef = NULL;
38+
}
39+
40+
_privateTransportKeyRef = privateTransportKeyRef;
41+
42+
if (_privateTransportKeyRef)
43+
{
44+
CFRetain(_privateTransportKeyRef);
45+
}
46+
}
47+
}
48+
49+
@end

IdentityCore/src/cache/crypto/MSIDWPJKeyPairWithCert.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ typedef NS_ENUM(NSInteger, MSIDWPJKeychainAccessGroup)
4747
NSString *_certificateSubject;
4848
NSString *_certificateIssuer;
4949
SecKeyRef _privateKeyRef;
50+
SecKeyRef _privateTransportKeyRef;
5051
}
5152

5253
@property (nonatomic, readonly) SecKeyRef privateKeyRef;
@@ -55,6 +56,8 @@ typedef NS_ENUM(NSInteger, MSIDWPJKeychainAccessGroup)
5556
@property (nonatomic, readonly) NSString *certificateSubject;
5657
@property (nonatomic, readonly) NSString *certificateIssuer;
5758
@property (nonatomic) MSIDWPJKeychainAccessGroup keyChainVersion;
59+
// The private session transport key. Only populated if the private STK is stored in the secure enclave.
60+
@property (nonatomic, readonly) SecKeyRef privateTransportKeyRef;
5861

5962
- (nullable instancetype)initWithPrivateKey:(SecKeyRef)privateKey
6063
certificate:(SecCertificateRef)certificate

IdentityCore/src/cache/crypto/MSIDWPJKeyPairWithCert.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ - (void)dealloc
101101
CFRelease(_privateKeyRef);
102102
_privateKeyRef = NULL;
103103
}
104+
105+
if (_privateTransportKeyRef)
106+
{
107+
CFRelease(_privateTransportKeyRef);
108+
_privateTransportKeyRef = NULL;
109+
}
104110
}
105111

106112
@end

IdentityCore/src/oauth2/MSIDExternalSSOContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
3737
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000
3838
@property (nonatomic, nullable, strong) ASAuthorizationProviderExtensionLoginManager *loginManager API_AVAILABLE(macos(13.0));
3939
@property (nonatomic) BOOL isDeviceRegistered API_AVAILABLE(macos(13.0));
40+
@property (nonatomic) BOOL isPlatformSSORegistrationFlow API_AVAILABLE(macos(13.0));
4041
#endif
4142
#endif
4243

IdentityCore/src/oauth2/token/MSIDPrimaryRefreshToken.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef NS_ENUM(NSInteger, MSIDExternalPRTKeyLocationType)
4949
@property (nonatomic) MSIDExternalPRTKeyLocationType externalKeyLocationType;
5050

5151
- (BOOL)isDevicelessPRT;
52+
- (BOOL)isDevicelessPRTv3;
5253
- (BOOL)shouldRefreshWithInterval:(NSUInteger)refreshInterval;
5354
- (NSUInteger)prtId;
5455

0 commit comments

Comments
 (0)