Skip to content
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

Move jsonWebKey creation to key pair class for Cpp integration. #1018

Merged
merged 11 commits into from
Jul 30, 2020
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [TBD] - TBD
* update new variable in configuration to allow user by pass URI check (#1013)
* add a new API to check if compatible AAD broker is available (#1011)
* update new variable in configuration to allow user by pass URI check #1013
* Refactor crypto code for cpp integration and add api to generate ephemeral asymmetric key pair. #1018

## [1.1.6] - 2020-07-24

Expand Down
4 changes: 2 additions & 2 deletions MSAL.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Pod::Spec.new do |s|
s.authors = { "Microsoft" => "nugetaad@microsoft.com" }
s.social_media_url = "https://twitter.com/azuread"
s.platform = :ios, :osx
s.ios.deployment_target = "10.0"
s.osx.deployment_target = "10.11"
s.ios.deployment_target = "11.0"
s.osx.deployment_target = "10.12"
s.source = {
:git => "https://github.com/AzureAD/microsoft-authentication-library-for-objc.git",
:tag => s.version.to_s,
Expand Down
2 changes: 1 addition & 1 deletion MSAL/IdentityCore
Submodule IdentityCore updated 26 files
+78 −14 IdentityCore/IdentityCore.xcodeproj/project.pbxproj
+1 −0 IdentityCore/src/MSIDBrokerConstants.h
+1 −0 IdentityCore/src/MSIDBrokerConstants.m
+2 −0 IdentityCore/src/cache/crypto/MSIDAssymetricKeyGenerating.h
+31 −18 IdentityCore/src/cache/crypto/MSIDAssymetricKeyKeychainGenerator.m
+2 −1 IdentityCore/src/cache/crypto/MSIDAssymetricKeyPair.h
+103 −72 IdentityCore/src/cache/crypto/MSIDAssymetricKeyPair.m
+0 −1 IdentityCore/src/controllers/MSIDBaseRequestController.m
+2 −10 IdentityCore/src/controllers/broker/ios/MSIDBrokerInteractiveController.m
+1 −1 IdentityCore/src/pop_manager/MSIDDevicePopManager.h
+5 −84 IdentityCore/src/pop_manager/MSIDDevicePopManager.m
+39 −0 IdentityCore/src/webview/operations/MSIDWebResponseBaseOperation.h
+44 −0 IdentityCore/src/webview/operations/MSIDWebResponseBaseOperation.m
+31 −0 IdentityCore/src/webview/operations/MSIDWebResponseBrokerInstallOperation.h
+107 −0 IdentityCore/src/webview/operations/MSIDWebResponseBrokerInstallOperation.m
+41 −0 IdentityCore/src/webview/operations/MSIDWebResponseOperationFactory.h
+84 −0 IdentityCore/src/webview/operations/MSIDWebResponseOperationFactory.m
+12 −0 IdentityCore/src/webview/response/MSIDWebWPJResponse.m
+1 −0 IdentityCore/src/webview/response/MSIDWebviewResponse.h
+5 −0 IdentityCore/src/webview/response/MSIDWebviewResponse.m
+4 −13 IdentityCore/src/webview/systemWebview/ios/MSIDSafariViewController.m
+6 −4 IdentityCore/tests/MSIDAssymetricKeyPair+Test.h
+66 −0 IdentityCore/tests/MSIDAssymetricKeyPair+Test.m
+1 −1 IdentityCore/tests/MSIDAssymetricKeychainGeneratorTests.m
+94 −0 IdentityCore/tests/integration/ios/MSIDWebResponseOperationFactoryTests.m
+3 −0 changelog.txt
42 changes: 26 additions & 16 deletions MSAL/MSAL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
04D32CD01FD8AFF3000B123E /* MSALErrorConverterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04D32CCF1FD8AFF3000B123E /* MSALErrorConverterTests.m */; };
04D32CD11FD8AFF3000B123E /* MSALErrorConverterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04D32CCF1FD8AFF3000B123E /* MSALErrorConverterTests.m */; };
1E04572324BD5A7D00444756 /* MSALCacheItemDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E04572024BD5A7D00444756 /* MSALCacheItemDetailViewController.m */; };
1E06CD6524D116F800E3D0E5 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A206371FC510B500755A51 /* Security.framework */; };
1E1A2E042256D12F001009ED /* MSALTestAppSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = D61A64B01E5AAC5C0086D120 /* MSALTestAppSettings.m */; };
1E1A2E062256D194001009ED /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E1A2E052256D194001009ED /* AppKit.framework */; };
1E3658A7247F2BB60044A072 /* MSALAuthenticationSchemeProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E3658A6247F2BB60044A072 /* MSALAuthenticationSchemeProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -1588,6 +1589,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1E06CD6524D116F800E3D0E5 /* Security.framework in Frameworks */,
B286B9E42389E751007833AD /* AuthenticationServices.framework in Frameworks */,
96902DF920E157B400200E6F /* WebKit.framework in Frameworks */,
231CE9DF1FEC7E8400E95D3E /* libIdentityTest.a in Frameworks */,
Expand Down Expand Up @@ -4059,6 +4061,7 @@
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
PRODUCT_NAME = "MSAL (iOS Static Library)";
};
name = Debug;
Expand All @@ -4069,6 +4072,7 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
PRODUCT_NAME = "MSAL (iOS Static Library)";
};
name = Release;
Expand All @@ -4080,6 +4084,7 @@
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_NAME = "MSAL (macOS Static Library)";
};
name = Debug;
Expand All @@ -4090,6 +4095,7 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_NAME = "MSAL (macOS Static Library)";
};
name = Release;
Expand Down Expand Up @@ -4232,6 +4238,7 @@
DEVELOPMENT_TEAM = UBF8T346G9;
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = "$(SRCROOT)/test/automation/ios/resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSALAutomationApp;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -4249,6 +4256,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = UBF8T346G9;
INFOPLIST_FILE = "$(SRCROOT)/test/automation/ios/resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSALAutomationApp;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -4308,7 +4316,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "$(SRCROOT)/test/unit/mac/unit-test-host/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -4369,7 +4377,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "$(SRCROOT)/test/unit/mac/unit-test-host/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.unit-test-host";
Expand Down Expand Up @@ -4432,7 +4440,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = test/automation/tests/interactive/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -4496,7 +4504,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = test/automation/tests/interactive/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MultiAppiOSTests;
Expand Down Expand Up @@ -4562,7 +4570,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = test/automation/tests/interactive/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks @executable_path/Frameworks $(inherited)";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -4627,7 +4635,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = test/automation/tests/interactive/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks @executable_path/Frameworks $(inherited)";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.InteractiveiOSTests;
Expand All @@ -4650,7 +4658,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = UBF8T346G9;
GCC_OPTIMIZATION_LEVEL = 0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSALTestApp;
PROVISIONING_PROFILE = "";
Expand All @@ -4667,7 +4675,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = UBF8T346G9;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSALTestApp;
PROVISIONING_PROFILE = "";
Expand All @@ -4683,7 +4691,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
GCC_OPTIMIZATION_LEVEL = 0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
USER_HEADER_SEARCH_PATHS = "$(inherited) $IDCORE_PATH/src/**";
};
name = Debug;
Expand All @@ -4695,7 +4703,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
USER_HEADER_SEARCH_PATHS = "$(inherited) $IDCORE_PATH/src/**";
};
name = Release;
Expand All @@ -4707,7 +4715,7 @@
CODE_SIGN_IDENTITY = "-";
DEVELOPMENT_TEAM = "";
GCC_OPTIMIZATION_LEVEL = 0;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
};
name = Debug;
};
Expand All @@ -4717,7 +4725,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
DEVELOPMENT_TEAM = "";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
rohitnarula7176 marked this conversation as resolved.
Show resolved Hide resolved
};
name = Release;
};
Expand All @@ -4730,7 +4738,7 @@
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
GCC_OPTIMIZATION_LEVEL = 0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
PROVISIONING_PROFILE_SPECIFIER = "";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/unit-test-host.app/unit-test-host";
USER_HEADER_SEARCH_PATHS = "$(inherited) $IDCORE_PATH/src/** $IDCORE_PATH/tests/util/** $IDCORE_PATH/tests/mocks/**";
Expand All @@ -4745,7 +4753,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
PROVISIONING_PROFILE_SPECIFIER = "";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/unit-test-host.app/unit-test-host";
USER_HEADER_SEARCH_PATHS = "$(inherited) $IDCORE_PATH/src/** $IDCORE_PATH/tests/util/** $IDCORE_PATH/tests/mocks/**";
Expand All @@ -4759,7 +4767,7 @@
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
GCC_OPTIMIZATION_LEVEL = 0;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
PROVISIONING_PROFILE_SPECIFIER = "";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/unit-test-host-mac.app/Contents/MacOS/unit-test-host-mac";
USER_HEADER_SEARCH_PATHS = "$(inherited) $IDCORE_PATH/src/** $IDCORE_PATH/tests/util/** $IDCORE_PATH/tests/mocks/**";
Expand All @@ -4772,7 +4780,7 @@
buildSettings = {
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.12;
PROVISIONING_PROFILE_SPECIFIER = "";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/unit-test-host-mac.app/Contents/MacOS/unit-test-host-mac";
USER_HEADER_SEARCH_PATHS = "$(inherited) $IDCORE_PATH/src/** $IDCORE_PATH/tests/util/** $IDCORE_PATH/tests/mocks/**";
Expand All @@ -4786,6 +4794,7 @@
CODE_SIGN_ENTITLEMENTS = "unit-test-host.entitlements";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
PROVISIONING_PROFILE_SPECIFIER = "";
};
name = Debug;
Expand All @@ -4797,6 +4806,7 @@
CODE_SIGN_ENTITLEMENTS = "unit-test-host.entitlements";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
PROVISIONING_PROFILE_SPECIFIER = "";
};
name = Release;
Expand Down
3 changes: 2 additions & 1 deletion MSAL/src/MSALAuthenticationSchemePop.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#import "MSALAuthScheme.h"
#import "MSIDAccessToken.h"
#import "MSIDDefaultTokenCacheAccessor.h"
#import "MSIDAssymetricKeyPair.h"

static NSString *keyDelimiter = @" ";

Expand Down Expand Up @@ -72,7 +73,7 @@ - (MSIDAuthenticationScheme *)createMSIDAuthenticationSchemeWithParams:(nullable
- (NSDictionary *)getSchemeParameters:(MSIDDevicePopManager *)popManager
{
NSMutableDictionary *schemeParams = [NSMutableDictionary new];
NSString *requestConf = popManager.requestConfirmation;
NSString *requestConf = popManager.keyPair.jsonWebKey;
if (requestConf)
{
[schemeParams setObject:MSALParameterStringForAuthScheme(self.scheme) forKey:MSID_OAUTH2_TOKEN_TYPE];
Expand Down
11 changes: 3 additions & 8 deletions MSAL/test/app/ios/MSALTestAppCacheViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#import "MSIDAssymetricKeyLookupAttributes.h"
#import "MSIDAssymetricKeyKeychainGenerator+Internal.h"
#import "MSALTestAppAsymmetricKey.h"
#import "MSIDDevicePopManager+Internal.h"
#import "MSIDDevicePopManager.h"
#import "MSIDCacheConfig.h"
#import "MSIDAssymetricKeyPair.h"
#import "MSIDAuthScheme.h"
Expand Down Expand Up @@ -106,11 +106,7 @@ - (id)init

[self setEdgesForExtendedLayout:UIRectEdgeNone];
[self setExtendedLayoutIncludesOpaqueBars:NO];
#if TARGET_OS_MACCATALYST
_cacheTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
#else
[self setAutomaticallyAdjustsScrollViewInsets:NO];
#endif

self.legacyAccessor = [[MSIDLegacyTokenCacheAccessor alloc] initWithDataSource:MSIDKeychainTokenCache.defaultKeychainCache otherCacheAccessors:nil];
self.defaultAccessor = [[MSIDDefaultTokenCacheAccessor alloc] initWithDataSource:MSIDKeychainTokenCache.defaultKeychainCache otherCacheAccessors:@[self.legacyAccessor]];
Expand Down Expand Up @@ -353,9 +349,8 @@ - (void)loadCache
MSIDAssymetricKeyPair *keyPair = [self.keyGenerator readKeyPairForAttributes:_keyPairAttributes error:nil];
if (keyPair)
{
NSString *kid = [_popManager generateKidFromModulus:keyPair.keyModulus exponent:keyPair.keyExponent];
MSALTestAppAsymmetricKey *publicKey = [[MSALTestAppAsymmetricKey alloc] initWithName:self.keyPairAttributes.publicKeyIdentifier kid:kid];
MSALTestAppAsymmetricKey *privateKey = [[MSALTestAppAsymmetricKey alloc] initWithName:self.keyPairAttributes.privateKeyIdentifier kid:kid];
MSALTestAppAsymmetricKey *publicKey = [[MSALTestAppAsymmetricKey alloc] initWithName:self.keyPairAttributes.publicKeyIdentifier kid:keyPair.kid];
rohitnarula7176 marked this conversation as resolved.
Show resolved Hide resolved
MSALTestAppAsymmetricKey *privateKey = [[MSALTestAppAsymmetricKey alloc] initWithName:self.keyPairAttributes.privateKeyIdentifier kid:keyPair.kid];
_tokenKeys = [[NSMutableArray alloc] initWithObjects:publicKey, privateKey, nil];
[_cacheSections setObject:_tokenKeys forKey:POP_TOKEN_KEYS];
[_cacheSectionTitles addObject:POP_TOKEN_KEYS];
Expand Down
7 changes: 3 additions & 4 deletions MSAL/test/app/mac/MSALCacheViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#import "MSIDAssymetricKeyLookupAttributes.h"
#import "MSIDAssymetricKeyKeychainGenerator+Internal.h"
#import "MSALTestAppAsymmetricKey.h"
#import "MSIDDevicePopManager+Internal.h"
#import "MSIDDevicePopManager.h"
#import "MSIDCacheConfig.h"
#import "MSIDAssymetricKeyPair.h"
#import "MSIDAuthScheme.h"
Expand Down Expand Up @@ -166,9 +166,8 @@ - (void)loadCache
MSIDAssymetricKeyPair *keyPair = [self.keyGenerator readKeyPairForAttributes:_keyPairAttributes error:nil];
if (keyPair)
{
NSString *kid = [_popManager generateKidFromModulus:keyPair.keyModulus exponent:keyPair.keyExponent];
MSALTestAppAsymmetricKey *publicKey = [[MSALTestAppAsymmetricKey alloc] initWithName:self.keyPairAttributes.publicKeyIdentifier kid:kid];
MSALTestAppAsymmetricKey *privateKey = [[MSALTestAppAsymmetricKey alloc] initWithName:self.keyPairAttributes.privateKeyIdentifier kid:kid];
MSALTestAppAsymmetricKey *publicKey = [[MSALTestAppAsymmetricKey alloc] initWithName:self.keyPairAttributes.publicKeyIdentifier kid:keyPair.kid];
MSALTestAppAsymmetricKey *privateKey = [[MSALTestAppAsymmetricKey alloc] initWithName:self.keyPairAttributes.privateKeyIdentifier kid:keyPair.kid];
_tokenKeys = [[NSMutableArray alloc] initWithObjects:publicKey, privateKey, nil];
[self.cacheDict setObject:_tokenKeys forKey:s_pop_token_keys];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ + (void)reset
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
- (id)initWithURL:(NSURL *)URL
{
return [self initWithURL:URL entersReaderIfAvailable:NO];
return [self initWithURL:URL configuration:[SFSafariViewControllerConfiguration new]];
}

- (id)initWithURL:(NSURL *)URL entersReaderIfAvailable:(BOOL)entersReaderIfAvailable
- (id)initWithURL:(NSURL *)URL configuration:(SFSafariViewControllerConfiguration *)configuration
{
MSALFakeViewController *fakeController = [MSALFakeViewController new];
if (s_svcValidationBlock)
{
s_svcValidationBlock(fakeController, URL, entersReaderIfAvailable);
s_svcValidationBlock(fakeController, URL, configuration.entersReaderIfAvailable);
}
return (SFSafariViewController *)fakeController;
}
Expand Down