-
Notifications
You must be signed in to change notification settings - Fork 36
[minor][engg]: Add error code handling for 50142 error returned by ESTS #1692
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
base: dev
Are you sure you want to change the base?
Changes from all commits
db9014c
0f991da
dd8c52d
ed643b0
8322a1b
f74513e
caa70e9
d90ad3a
f2466fa
6dd6a85
0991c8a
5481a72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -367,6 +367,9 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode) | |
|
|
||
| // Broker Xpc internal error | ||
| MSIDErrorBrokerXpcUnexpectedError = -52001, | ||
|
|
||
| // Error thrown when oauth error = MSIDServerInvalidRequest and error_code = 50142 (SecureChangePasswordDueToConditionalAccess) | ||
| MSIDErrorServerInvalidRequestResetPasswordRequired = -50142, | ||
|
Comment on lines
+371
to
+372
|
||
|
|
||
| }; | ||
|
|
||
|
|
@@ -376,6 +379,8 @@ extern MSIDErrorCode MSIDErrorCodeForOAuthError(NSString * _Nullable oauthError, | |
|
|
||
| extern MSIDErrorCode MSIDErrorCodeForOAuthErrorWithSubErrorCode(NSString * _Nullable oauthError, MSIDErrorCode defaultCode, NSString * _Nullable subError); | ||
|
|
||
| extern MSIDErrorCode MSIDErrorCodeForOAuthErrorWithSTSErrorCodes(NSString * _Nullable oauthError, MSIDErrorCode defaultCode, NSArray<NSNumber *> * _Nullable stsErrorCodes); | ||
|
|
||
| extern NSDictionary<NSString *, NSArray *> * _Nonnull MSIDErrorDomainsAndCodes(void); | ||
|
|
||
| extern void MSIDFillAndLogError(NSError * _Nullable __autoreleasing * _Nullable error, MSIDErrorCode errorCode, NSString * _Nullable errorDescription, NSUUID * _Nullable correlationID); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,20 @@ | |
| userInfo:additionalUserInfo]; | ||
| } | ||
|
|
||
| MSIDErrorCode MSIDErrorCodeForOAuthErrorWithSTSErrorCodes(NSString *oauthError, MSIDErrorCode defaultCode, NSArray<NSNumber *> *stsErrorCodes) | ||
| { | ||
| if (stsErrorCodes.count == 0) | ||
| { | ||
| return MSIDErrorCodeForOAuthError(oauthError, defaultCode); | ||
| } | ||
| if (oauthError && [oauthError caseInsensitiveCompare:@"invalid_request"] == NSOrderedSame | ||
| && [stsErrorCodes containsObject:@50142]) | ||
| { | ||
|
Comment on lines
+84
to
+86
|
||
| return MSIDErrorServerInvalidRequestResetPasswordRequired; | ||
| } | ||
| return MSIDErrorCodeForOAuthError(oauthError, defaultCode); | ||
| } | ||
|
|
||
| MSIDErrorCode MSIDErrorCodeForOAuthError(NSString *oauthError, MSIDErrorCode defaultCode) | ||
| { | ||
| if (oauthError && [oauthError caseInsensitiveCompare:@"invalid_request"] == NSOrderedSame) | ||
|
|
@@ -228,6 +242,7 @@ MSIDErrorCode MSIDErrorCodeForOAuthErrorWithSubErrorCode(NSString *oauthError, M | |
| @(MSIDErrorServerProtectionPoliciesRequired), | ||
| @(MSIDErrorAuthorizationFailed), | ||
| @(MSIDErrorServerError), | ||
| @(MSIDErrorServerInvalidRequestResetPasswordRequired), | ||
| ], | ||
| MSIDHttpErrorCodeDomain : @[ | ||
| @(MSIDErrorServerUnhandledResponse), | ||
|
|
@@ -307,6 +322,8 @@ void MSIDFillAndLogError(NSError **error, MSIDErrorCode errorCode, NSString *err | |
| return @"MSIDErrorServerProtectionPoliciesRequired"; | ||
| case MSIDErrorAuthorizationFailed: | ||
| return @"MSIDErrorAuthorizationFailed"; | ||
| case MSIDErrorServerInvalidRequestResetPasswordRequired: | ||
| return @"MSIDErrorServerInvalidRequestResetPasswordRequired"; | ||
| // HTTP errors | ||
| case MSIDErrorServerUnhandledResponse: | ||
| return @"MSIDErrorServerUnhandledResponse"; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not update changelog.txt.
Please consider if this change would be noticeable to a partner or user and either update changelog.txt or resolve this conversation.