Skip to content
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

Fix project - integrate fixed MSID #283

Merged
merged 5 commits into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MSAL/IdentityCore
Submodule IdentityCore updated 92 files
+229 −34 IdentityCore/IdentityCore.xcodeproj/project.pbxproj
+8 −0 IdentityCore/IdentityCore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+43 −1 IdentityCore/src/MSIDError.h
+21 −1 IdentityCore/src/MSIDError.m
+6 −0 IdentityCore/src/MSIDOAuth2Constants.h
+7 −0 IdentityCore/src/MSIDOAuth2Constants.m
+0 −1 IdentityCore/src/cache/accessor/MSIDLegacyTokenCacheAccessor.m
+1 −14 IdentityCore/src/configuration/MSIDConfiguration.h
+1 −13 IdentityCore/src/configuration/MSIDConfiguration.m
+3 −5 IdentityCore/src/configuration/MSIDNetworkConfiguration.h
+12 −25 IdentityCore/src/configuration/MSIDNetworkConfiguration.m
+28 −7 IdentityCore/src/configuration/webview/MSIDWebviewConfiguration.h
+29 −0 IdentityCore/src/configuration/webview/MSIDWebviewConfiguration.m
+9 −7 IdentityCore/src/oauth2/MSIDOauth2Factory.h
+12 −11 IdentityCore/src/oauth2/MSIDOauth2Factory.m
+1 −18 IdentityCore/src/oauth2/MSIDTokenResponse.m
+57 −0 IdentityCore/src/oauth2/MSIDWebviewFactory.h
+181 −0 IdentityCore/src/oauth2/MSIDWebviewFactory.m
+13 −0 IdentityCore/src/oauth2/aad_base/MSIDAADOauth2Factory.m
+28 −0 IdentityCore/src/oauth2/aad_base/MSIDAADWebviewFactory.h
+89 −0 IdentityCore/src/oauth2/aad_base/MSIDAADWebviewFactory.m
+12 −11 IdentityCore/src/oauth2/aad_v1/MSIDAADV1Oauth2Factory.m
+28 −0 IdentityCore/src/oauth2/aad_v1/MSIDAADV1WebviewFactory.h
+43 −0 IdentityCore/src/oauth2/aad_v1/MSIDAADV1WebviewFactory.m
+8 −10 IdentityCore/src/oauth2/aad_v2/MSIDAADV2Oauth2Factory.m
+29 −0 IdentityCore/src/oauth2/aad_v2/MSIDAADV2WebviewFactory.h
+57 −0 IdentityCore/src/oauth2/aad_v2/MSIDAADV2WebviewFactory.m
+0 −1 IdentityCore/src/oauth2/account/MSIDAccount.m
+0 −1 IdentityCore/src/oauth2/token/MSIDAccessToken.m
+0 −1 IdentityCore/src/oauth2/token/MSIDBaseToken.m
+1 −1 IdentityCore/src/util/MSIDTestIdTokenUtil.m
+2 −0 IdentityCore/src/util/NSDictionary+MSIDExtensions.h
+18 −0 IdentityCore/src/util/NSDictionary+MSIDExtensions.m
+3 −0 IdentityCore/src/util/NSString+MSIDExtensions.h
+48 −8 IdentityCore/src/util/NSString+MSIDExtensions.m
+37 −0 IdentityCore/src/util/ios/MSIDAppExtensionUtil.h
+70 −0 IdentityCore/src/util/ios/MSIDAppExtensionUtil.m
+28 −0 IdentityCore/src/util/ios/UIApplication+MSIDExtensions.h
+67 −0 IdentityCore/src/util/ios/UIApplication+MSIDExtensions.m
+41 −11 IdentityCore/src/webview/MSIDWebviewAuthorization.h
+158 −11 IdentityCore/src/webview/MSIDWebviewAuthorization.m
+5 −2 IdentityCore/src/webview/MSIDWebviewInteracting.h
+51 −0 IdentityCore/src/webview/MSIDWebviewSession.h
+59 −0 IdentityCore/src/webview/MSIDWebviewSession.m
+2 −0 IdentityCore/src/webview/embeddedWebview/MSIDOAuth2EmbeddedWebviewController.h
+2 −2 IdentityCore/src/webview/embeddedWebview/MSIDOAuth2EmbeddedWebviewController.m
+36 −0 IdentityCore/src/webview/pkce/MSIDPkce.h
+74 −0 IdentityCore/src/webview/pkce/MSIDPkce.m
+1 −1 IdentityCore/src/webview/response/MSIDWebAADAuthResponse.h
+11 −0 IdentityCore/src/webview/response/MSIDWebAADAuthResponse.m
+3 −4 IdentityCore/src/webview/response/MSIDWebOAuth2Response.h
+50 −0 IdentityCore/src/webview/response/MSIDWebOAuth2Response.m
+2 −2 IdentityCore/src/webview/response/MSIDWebWPJAuthResponse.h
+29 −0 IdentityCore/src/webview/response/MSIDWebWPJAuthResponse.m
+41 −0 IdentityCore/src/webview/response/MSIDWebviewResponse.h
+64 −0 IdentityCore/src/webview/response/MSIDWebviewResponse.m
+41 −0 IdentityCore/src/webview/systemWebview/MSIDSFAuthenticationSession.h
+108 −0 IdentityCore/src/webview/systemWebview/MSIDSFAuthenticationSession.m
+40 −0 IdentityCore/src/webview/systemWebview/MSIDSafariViewController.h
+145 −0 IdentityCore/src/webview/systemWebview/MSIDSafariViewController.m
+11 −0 IdentityCore/src/webview/systemWebview/MSIDSystemWebviewController.h
+82 −2 IdentityCore/src/webview/systemWebview/MSIDSystemWebviewController.m
+1 −1 IdentityCore/tests/MSIDAADOauth2FactoryTests.m
+1 −1 IdentityCore/tests/MSIDAADTokenResponseTests.m
+5 −1 IdentityCore/tests/MSIDAADV1Oauth2FactoryTests.m
+10 −5 IdentityCore/tests/MSIDAADV2Oauth2FactoryTests.m
+108 −0 IdentityCore/tests/MSIDAADV2WebviewFactoryTests.m
+129 −0 IdentityCore/tests/MSIDAADWebviewFactoryTests.m
+1 −1 IdentityCore/tests/MSIDAccountCacheItemTests.m
+1 −1 IdentityCore/tests/MSIDAccountTests.m
+1 −1 IdentityCore/tests/MSIDCredentialCacheItemTests.m
+7 −2 IdentityCore/tests/MSIDOauth2FactoryTests.m
+70 −0 IdentityCore/tests/MSIDSystemWebviewControllerTests.m
+1 −1 IdentityCore/tests/MSIDTokenFilteringHelperTests.m
+81 −0 IdentityCore/tests/MSIDWebAADAuthResponseTests.m
+92 −0 IdentityCore/tests/MSIDWebOAuth2ResponseTests.m
+68 −0 IdentityCore/tests/MSIDWebWPJResponseTests.m
+243 −0 IdentityCore/tests/MSIDWebviewAuthorizationTests.m
+259 −0 IdentityCore/tests/MSIDWebviewFactoryTests.m
+71 −0 IdentityCore/tests/MSIDWebviewResponseTests.m
+1 −1 IdentityCore/tests/integration/MSIDDefaultAccessorSSOIntegrationTests.m
+1 −1 IdentityCore/tests/integration/MSIDDefaultTokenCacheIntegrationTests.m
+1 −1 IdentityCore/tests/integration/MSIDLegacyAccessorSSOIntegrationTests.m
+1 −1 IdentityCore/tests/integration/MSIDLegacyTokenCacheIntegrationTests.m
+1 −1 IdentityCore/tests/integration/ios/MSIDWipeDataTelemetryTests.m
+1 −1 IdentityCore/tests/util/MSIDTestBrokerResponse.m
+4 −0 IdentityCore/tests/util/MSIDTestIdentifiers.h
+38 −0 IdentityCore/tests/util/MSIDTestWebviewInteractingViewController.h
+73 −0 IdentityCore/tests/util/MSIDTestWebviewInteractingViewController.m
+1 −1 IdentityCore/tests/util/cache/MSIDTestConfiguration.m
+1 −1 IdentityCore/tests/util/cache/MSIDTestTokenResponse.m
+1 −1 IdentityCore/xcconfig/identitycore__common__ios.xcconfig
1 change: 1 addition & 0 deletions MSAL/src/MSALErrorConverter.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ + (void)initialize
@(MSIDErrorInvalidRequest) :@(MSALErrorInvalidRequest),
@(MSIDErrorInvalidClient) : @(MSALErrorInvalidClient),
@(MSIDErrorInvalidGrant) : @(MSALErrorInvalidParameter),
@(MSIDErrorInvalidScope) : @(MSALErrorInvalidParameter),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have an MSAL error to return invalid scope? same for invalid grant :)

@(MSIDErrorInvalidParameter) : @(MSALErrorInvalidParameter),
@(MSIDErrorServerRefreshTokenRejected) : @(MSALErrorAuthorizationFailed),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better corresponding error code than MSALErrorAuthorizationFailed (which sounds more like interactive error)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added corresponding error for msal. also filed an issue to improve refactoring #285

@(MSIDErrorServerOauth) : @(MSALErrorAuthorizationFailed),
Expand Down
6 changes: 2 additions & 4 deletions MSAL/test/automation/ios/MSALAutoMainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ - (IBAction)expireAccessToken:(__unused id)sender
MSIDConfiguration *configuration = [[MSIDConfiguration alloc] initWithAuthority:[[NSURL alloc] initWithString:parameters[MSAL_AUTHORITY_PARAM]]
redirectUri:nil
clientId:parameters[MSAL_CLIENT_ID_PARAM]
target:parameters[MSAL_SCOPES_PARAM]
correlationId:nil];
target:parameters[MSAL_SCOPES_PARAM]];

__auto_type accessToken = [self.defaultAccessor getAccessTokenForAccount:account configuration:configuration context:nil error:nil];
accessToken.expiresOn = [NSDate dateWithTimeIntervalSinceNow:-1.0];
Expand Down Expand Up @@ -320,8 +319,7 @@ - (IBAction)invalidateRefreshToken:(__unused id)sender
MSIDConfiguration *configuration = [[MSIDConfiguration alloc] initWithAuthority:[[NSURL alloc] initWithString:parameters[MSAL_AUTHORITY_PARAM]]
redirectUri:nil
clientId:parameters[MSAL_CLIENT_ID_PARAM]
target:parameters[MSAL_SCOPES_PARAM]
correlationId:nil];
target:parameters[MSAL_SCOPES_PARAM]];

__auto_type refreshToken = [self.defaultAccessor getRefreshTokenWithAccount:account
familyId:nil
Expand Down
2 changes: 1 addition & 1 deletion MSAL/test/unit/MSALAcquireTokenTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#import "MSIDTestTokenResponse.h"
#import "MSIDTestConfiguration.h"
#import "MSIDAADV2TokenResponse.h"
#import "MSIDTestCacheIdentifiers.h"
#import "MSIDTestIdentifiers.h"
#import "MSALAccount+Internal.h"
#import "MSIDClientInfo.h"
#import "MSIDTestIdTokenUtil.h"
Expand Down
1 change: 1 addition & 0 deletions MSAL/test/unit/MSALErrorConverterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ - (void)testErrorConversion_whenErrorConverterInitialized_shouldMapAllMSIDErrors
errorCode == MSIDErrorInvalidRequest ||
errorCode == MSIDErrorInvalidClient ||
errorCode == MSIDErrorInvalidGrant ||
errorCode == MSIDErrorInvalidScope ||
errorCode == MSIDErrorInvalidParameter)
{
domain = MSIDOAuthErrorDomain;
Expand Down