File tree Expand file tree Collapse file tree 3 files changed +2
-25
lines changed
Expand file tree Collapse file tree 3 files changed +2
-25
lines changed Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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" ,
You can’t perform that action at this time.
0 commit comments