-
Notifications
You must be signed in to change notification settings - Fork 36
Error code & other related tasks refactoring #153
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
Conversation
IdentityCore/src/MSIDError.h
Outdated
// Server returned a refresh token reject response | ||
MSIDErrorServerRefreshTokenRejected = -51403, | ||
// Other specific server response errors | ||
MSIDErrorInvalidRequest = -51404, |
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.
nit: should it also have "server" in it?
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.
done
IdentityCore/src/MSIDError.h
Outdated
*/ | ||
MSIDErrorSessionCanceled = -51020, | ||
// The interactive flow was cancelled programmatically. | ||
MSIDErrorSessionCanceled = -51513, |
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.
nit: can the error name "hint" that it was canceled programmatically?
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.
done
@@ -101,7 +101,7 @@ - (MSIDAccountType)accountType | |||
|
|||
- (MSIDErrorCode)oauthErrorCode | |||
{ | |||
return MSIDErrorCodeForOAuthError(self.error, MSIDErrorInteractionRequired); | |||
return MSIDErrorCodeForOAuthError(self.error, MSIDErrorServerOauth); |
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.
will the clients know to show UI on MSIDErrorServerOauth? I think the reason to have MSIDErrorInteractionRequired as default is so that client show UI in MSAL? Can we check what was MSAL and ADAL implementation before?
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.
Top level : Interaction required
Underlying : ServerOAuth
and double check converter in MSAL and ADAL
@@ -45,7 +45,10 @@ - (instancetype)initWithURL:(NSURL *)url | |||
{ | |||
if (error) | |||
{ | |||
*error = MSIDCreateError(MSIDOAuthErrorDomain, MSIDErrorInvalidParameter, @"Unexpected error has occured. There is no auth code nor an error", nil, nil, nil, context.correlationId, nil); | |||
*error = MSIDCreateError(MSIDOAuthErrorDomain, | |||
MSIDErrorServerInvalidResponse, |
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.
👍
…ft-authentication-library-common-for-objc into jak/additional-integration-fixes
AzureAD/azure-activedirectory-library-for-objc#1213 AzureAD/microsoft-authentication-library-for-objc#283 updated in ADAL and MSAL respectively in their PRs. |
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.
Just a couple of questions and nit fixes :)
@@ -134,7 +134,6 @@ | |||
6035CD8D207EA67300369E69 /* MSIDTelemetryIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6035CD8B207EA67300369E69 /* MSIDTelemetryIntegrationTests.m */; }; | |||
6057EE9020B5FDF8007976EB /* MSIDAADOAuthEmbeddedWebviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6057EE8F20B5FDF8007976EB /* MSIDAADOAuthEmbeddedWebviewController.m */; }; | |||
6057EE9120B5FDF8007976EB /* MSIDAADOAuthEmbeddedWebviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6057EE8F20B5FDF8007976EB /* MSIDAADOAuthEmbeddedWebviewController.m */; }; | |||
606830052098ACED00CCA6AB /* MSIDNegotiateHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 606830042098ACED00CCA6AB /* MSIDNegotiateHandler.m */; }; |
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.
why this got removed?
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.
It was removed for iOS. There is a separate issue for this in #157
IdentityCore/src/MSIDError.m
Outdated
// Authority Validation Errors | ||
@(MSIDErrorAuthorityValidation), | ||
@(MSIDErrorAuthorityValidation), | ||
@(MSIDErrorAuthorityValidation), |
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.
MSIDErrorAuthorityValidation error is triple :)
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.
woops, removed.
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.
👍
@@ -83,7 +83,7 @@ + (void)startSession:(MSIDWebviewSession *)session | |||
// check session nil | |||
if (!session) | |||
{ | |||
NSError *error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInvalidRequest, @"Interactive session failed to create.", nil, nil, nil, context.correlationId, nil); | |||
NSError *error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInvalidDeveloperParameter, @"Interactive session failed to create.", nil, nil, nil, context.correlationId, nil); |
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.
why is this developer parameter? This feels like it would be MSAL internal error or system error :)
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.
It is an argument to the method itself. But I do understand where the argument is coming from - this method is only called by other methods that should create a session.
Thus, changing it to MSIDErrorInvalidInternalParameter.
@@ -114,7 +114,16 @@ - (void)cancel | |||
MSID_LOG_INFO(self.context, @"Cancel Web Auth..."); | |||
|
|||
// End web auth with error | |||
NSError *error = MSIDCreateError(MSIDErrorDomain, MSIDErrorUserCancel, @"The user/application has cancelled the authorization.", nil, nil, nil, self.context.correlationId, nil); | |||
NSError *error = MSIDCreateError(MSIDErrorDomain, MSIDErrorSessionCanceledProgramatically, @"Authorization session was cancelled programatically.", nil, nil, nil, self.context.correlationId, nil); |
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.
👍
self.navigationItem.leftBarButtonItem = cancelButton; | ||
} | ||
|
||
// Authentication was cancelled by the user | ||
- (IBAction)onCancel:(__unused id)sender |
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.
just confirming if this was changed also in the subclasses, because I didn't see onCancel changes in the subclasses :)
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.
onCancel method is no longer needed. Button was set up programatically to simply call "userCancel" now. Some comments around methods were added for clarity nonetheless.
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.
👍
Removed not-being-used errors, feel free to re-introduce them when needed.
Categorized errors into
Other additions: