@@ -1109,14 +1109,11 @@ - (void)testAcquireTokenSilent_whenKnownB2CAuthority_shouldNotValidate
1109
1109
MSALAccountId *accountId = [[MSALAccountId alloc ] initWithAccountIdentifier: @" uid.utid" objectId: @" uid" tenantId: @" utid" ];
1110
1110
MSALAccount *account = [[MSALAccount alloc ] initWithUsername: nil homeAccountId: accountId environment: @" myb2c.authority.com" tenantProfiles: nil ];
1111
1111
1112
- MSALWebviewParameters *webParameters = [[MSALWebviewParameters alloc ] initWithAuthPresentationViewController: [self .class sharedViewControllerStub ]];
1113
- MSALInteractiveTokenParameters *parameters = [[MSALInteractiveTokenParameters alloc ] initWithScopes: @[@" fakescope1" , @" fakescope2" ]
1114
- webviewParameters: webParameters];
1115
- parameters.account = account;
1112
+ MSALSilentTokenParameters *parameters = [[MSALSilentTokenParameters alloc ] initWithScopes: @[@" fakescope1" , @" fakescope2" ]
1113
+ account: account];
1116
1114
1117
- [application acquireTokenWithParameters: parameters
1118
- completionBlock: ^(MSALResult *result, NSError *error)
1119
- {
1115
+ [application acquireTokenSilentWithParameters: parameters
1116
+ completionBlock: ^(MSALResult * _Nullable result, NSError * _Nullable error) {
1120
1117
XCTAssertNil (result);
1121
1118
XCTAssertNotNil (error);
1122
1119
}];
@@ -1157,14 +1154,11 @@ - (void)testAcquireTokenSilent_whenNoTfpAuthority_shouldNotValidate
1157
1154
MSALAccountId *accountId = [[MSALAccountId alloc ] initWithAccountIdentifier: @" uid.utid" objectId: @" uid" tenantId: @" utid" ];
1158
1155
MSALAccount *account = [[MSALAccount alloc ] initWithUsername: nil homeAccountId: accountId environment: @" myb2c.authority.com" tenantProfiles: nil ];
1159
1156
1160
- MSALWebviewParameters *webParameters = [[MSALWebviewParameters alloc ] initWithAuthPresentationViewController: [self .class sharedViewControllerStub ]];
1161
- MSALInteractiveTokenParameters *parameters = [[MSALInteractiveTokenParameters alloc ] initWithScopes: @[@" fakescope1" , @" fakescope2" ]
1162
- webviewParameters: webParameters];
1163
- parameters.account = account;
1157
+ MSALSilentTokenParameters *parameters = [[MSALSilentTokenParameters alloc ] initWithScopes: @[@" fakescope1" , @" fakescope2" ]
1158
+ account: account];
1164
1159
1165
- [application acquireTokenWithParameters: parameters
1166
- completionBlock: ^(MSALResult *result, NSError *error)
1167
- {
1160
+ [application acquireTokenSilentWithParameters: parameters
1161
+ completionBlock: ^(MSALResult * _Nullable result, NSError * _Nullable error) {
1168
1162
XCTAssertNil (result);
1169
1163
XCTAssertNotNil (error);
1170
1164
}];
@@ -1198,7 +1192,7 @@ - (void)testAcquireScopesLoginHint
1198
1192
MSIDInteractiveTokenRequestParameters *params = [obj interactiveRequestParamaters ];
1199
1193
XCTAssertNotNil (params);
1200
1194
1201
- NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireWithHint ];
1195
+ NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireWithTokenParameters ];
1202
1196
XCTAssertEqualObjects (params.telemetryApiId , expectedApiId);
1203
1197
XCTAssertEqualObjects (params.authority .url .absoluteString , @" https://login.microsoftonline.com/common" );
1204
1198
XCTAssertEqualObjects (params.target , @" fakescope1 fakescope2" );
@@ -1404,7 +1398,7 @@ - (void)testAcquireScopesWithAccount
1404
1398
MSIDInteractiveTokenRequestParameters *params = [obj interactiveRequestParamaters ];
1405
1399
XCTAssertNotNil (params);
1406
1400
1407
- NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireWithUserPromptTypeAndParameters ];
1401
+ NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireWithTokenParameters ];
1408
1402
XCTAssertEqualObjects (params.telemetryApiId , expectedApiId);
1409
1403
XCTAssertEqualObjects (params.authority .url .absoluteString , @" https://login.microsoftonline.com/common" );
1410
1404
XCTAssertEqualObjects (params.providedAuthority .url .absoluteString , @" https://login.microsoftonline.com/common" );
@@ -1622,7 +1616,7 @@ - (void)testAcquireSilentScopesUser
1622
1616
MSIDRequestParameters *params = [obj requestParameters ];
1623
1617
XCTAssertNotNil (params);
1624
1618
1625
- NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireSilentWithUser ];
1619
+ NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireSilentWithTokenParameters ];
1626
1620
XCTAssertEqualObjects (params.telemetryApiId , expectedApiId);
1627
1621
XCTAssertEqualObjects (params.
accountIdentifier .
displayableId ,
@" [email protected] " );
1628
1622
XCTAssertEqualObjects (params.accountIdentifier .homeAccountId , @" 1.1234-5678-90abcdefg" );
@@ -1698,7 +1692,7 @@ - (void)testAcquireSilentScopesUserAuthority
1698
1692
MSIDRequestParameters *params = [obj requestParameters ];
1699
1693
XCTAssertNotNil (params);
1700
1694
1701
- NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireSilentWithUserAndAuthority ];
1695
+ NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireSilentWithTokenParameters ];
1702
1696
XCTAssertEqualObjects (params.telemetryApiId , expectedApiId);
1703
1697
XCTAssertEqualObjects (params.
accountIdentifier .
displayableId ,
@" [email protected] " );
1704
1698
XCTAssertEqualObjects (params.accountIdentifier .homeAccountId , @" 1.1234-5678-90abcdefg" );
@@ -1826,7 +1820,7 @@ - (void)testAcquireSilentScopesUser_whenNoAuthority_andCommonAuthorityInPublicCl
1826
1820
MSIDRequestParameters *params = [obj requestParameters ];
1827
1821
XCTAssertNotNil (params);
1828
1822
1829
- NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireSilentWithUser ];
1823
+ NSString *expectedApiId = [NSString stringWithFormat: @" %ld " , (long )MSALTelemetryApiIdAcquireSilentWithTokenParameters ];
1830
1824
XCTAssertEqualObjects (params.telemetryApiId , expectedApiId);
1831
1825
XCTAssertEqualObjects (params.
accountIdentifier .
displayableId ,
@" [email protected] " );
1832
1826
XCTAssertEqualObjects (params.accountIdentifier .homeAccountId , @" 1.1234-5678-90abcdefg" );
0 commit comments