Skip to content

Commit 0991c8a

Browse files
Fidelia NawarFidelia Nawar
authored andcommitted
fixing tests
1 parent 6dd6a85 commit 0991c8a

File tree

3 files changed

+2
-25
lines changed

3 files changed

+2
-25
lines changed

IdentityCore/src/oauth2/MSIDOauth2Factory.m

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,8 @@ - (BOOL)verifyResponse:(MSIDTokenResponse *)response
8989
userInfo[MSIDBrokerVersionKey] = response.clientAppVersion;
9090
if (response.stsErrorCodes) userInfo[MSIDSTSErrorCodesKey] = response.stsErrorCodes;
9191

92-
// CHANGED: Use STS-aware lookup instead of response.oauthErrorCode
93-
MSIDErrorCode errorCode = MSIDErrorCodeForOAuthErrorWithSTSErrorCodes(
94-
response.error,
95-
MSIDErrorServerOauth,
96-
response.stsErrorCodes);
97-
9892
*error = MSIDCreateError(MSIDOAuthErrorDomain,
99-
errorCode,
93+
response.oauthErrorCode,
10094
response.errorDescription,
10195
response.error,
10296
nil,

IdentityCore/src/oauth2/MSIDTokenResponse.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ - (MSIDAccountType)accountType
118118

119119
- (MSIDErrorCode)oauthErrorCode
120120
{
121-
return MSIDErrorCodeForOAuthError(self.error, MSIDErrorServerOauth);
121+
return MSIDErrorCodeForOAuthErrorWithSTSErrorCodes(self.error, MSIDErrorServerOauth, self.stsErrorCodes);
122122
}
123123

124124
+ (MSIDProviderType)providerType

IdentityCore/tests/MSIDErrorTests.m

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,6 @@ - (void)testMSIDErrorWithInvalidRequestAndSTS50142ShouldReturnResetPasswordRequi
203203
XCTAssertEqual(result, MSIDErrorServerInvalidRequestResetPasswordRequired);
204204
}
205205

206-
- (void)testMSIDErrorWithInvalidRequestAndSTS50142AmongMultipleCodesShouldReturnResetPasswordRequired
207-
{
208-
MSIDErrorCode result = MSIDErrorCodeForOAuthErrorWithSTSErrorCodes(@"invalid_request",
209-
MSIDErrorServerOauth,
210-
@[@70000, @50142, @12345]);
211-
XCTAssertEqual(result, MSIDErrorServerInvalidRequestResetPasswordRequired);
212-
}
213-
214206
- (void)testMSIDErrorWithInvalidRequestAndDifferentSTSCodeShouldReturnInvalidRequest
215207
{
216208
MSIDErrorCode result = MSIDErrorCodeForOAuthErrorWithSTSErrorCodes(@"invalid_request",
@@ -219,15 +211,6 @@ - (void)testMSIDErrorWithInvalidRequestAndDifferentSTSCodeShouldReturnInvalidReq
219211
XCTAssertEqual(result, MSIDErrorServerInvalidRequest);
220212
}
221213

222-
- (void)testMSIDErrorWithInvalidGrantAndSTS50142ShouldReturnInvalidGrant
223-
{
224-
// 50142 only matters for invalid_request, not invalid_grant
225-
MSIDErrorCode result = MSIDErrorCodeForOAuthErrorWithSTSErrorCodes(@"invalid_grant",
226-
MSIDErrorServerOauth,
227-
@[@50142]);
228-
XCTAssertEqual(result, MSIDErrorServerInvalidGrant);
229-
}
230-
231214
- (void)testMSIDErrorWithNilSTSCodesShouldFallbackToBaseFunction
232215
{
233216
MSIDErrorCode result = MSIDErrorCodeForOAuthErrorWithSTSErrorCodes(@"invalid_request",

0 commit comments

Comments
 (0)