Skip to content

Commit

Permalink
Merge dev into release/1.6.0 (#2363)
Browse files Browse the repository at this point in the history
* Support caller app info for browser SSO flows  (#2347)

* modified:   MSAL/IdentityCore

* modified:   MSAL/IdentityCore

* modified:   MSAL/IdentityCore

* Update core.

* Add specific minimum version to match downloaded visionOS simulator's version

* Trigger Build

* Remove duplicated test, use proper name for test and skip test for macOS (#2362)

---------

Co-authored-by: Sergei Demchenko <[email protected]>
Co-authored-by: Juan Arias Roldan <[email protected]>
Co-authored-by: Juan Arias <[email protected]>
  • Loading branch information
4 people authored Oct 7, 2024
1 parent c478c3d commit cdcd03f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
2 changes: 2 additions & 0 deletions MSAL/MSAL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9009,6 +9009,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
TARGETED_DEVICE_FAMILY = "1,2,7";
XROS_DEPLOYMENT_TARGET = 1.2;
};
name = Debug;
};
Expand All @@ -9024,6 +9025,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
TARGETED_DEVICE_FAMILY = "1,2,7";
XROS_DEPLOYMENT_TARGET = 1.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ final class MSALNativeAuthUserAccountEndToEndTests: MSALNativeAuthEndToEndPasswo
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)
}

// Sign in with username and password to get access token and force refresh with existing scopes
func test_signInAndForceRefreshWithExistingScopesSucceeds() async throws {
// Sign in with username and password to get access token and force refresh with access token not linked to client Id
func test_signInAndForceRefreshWithNotConfiguredScopes() async throws {
#if os(macOS)
throw XCTSkip("Bundle id for macOS is not added to the client id, test is not needed on both iOS and macOS")
#endif
Expand All @@ -83,38 +83,6 @@ final class MSALNativeAuthUserAccountEndToEndTests: MSALNativeAuthEndToEndPasswo
XCTAssertNotNil(signInDelegateSpy.result?.idToken)
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)

let previousIdToken = signInDelegateSpy.result?.idToken
let refreshAccessTokenExpectation = expectation(description: "refreshing access token")
let credentialsDelegateSpy = CredentialsDelegateSpy(expectation: refreshAccessTokenExpectation)

signInDelegateSpy.result?.getAccessToken(scopes: ["User.Read"], forceRefresh: true, delegate: credentialsDelegateSpy)

await fulfillment(of: [refreshAccessTokenExpectation])

XCTAssertTrue(credentialsDelegateSpy.onAccessTokenRetrieveCompletedCalled)
XCTAssertNotNil(credentialsDelegateSpy.result?.accessToken)
XCTAssertNotEqual(previousIdToken, signInDelegateSpy.result?.idToken)
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)
}

// Sign in with username and password to get access token and force refresh with different scopes
func test_signInAndForceRefreshWithDifferentScopesFails() async throws {
guard let sut = initialisePublicClientApplication(), let username = retrieveUsernameForSignInUsernameAndPassword(), let password = await retrievePasswordForSignInUsername() else {
XCTFail("Missing information")
return
}

let signInExpectation = expectation(description: "signing in")
let signInDelegateSpy = SignInPasswordStartDelegateSpy(expectation: signInExpectation)

sut.signIn(username: username, password: password, correlationId: correlationId, delegate: signInDelegateSpy)

await fulfillment(of: [signInExpectation])

XCTAssertTrue(signInDelegateSpy.onSignInCompletedCalled)
XCTAssertNotNil(signInDelegateSpy.result?.idToken)
XCTAssertEqual(signInDelegateSpy.result?.account.username, username)

let refreshAccessTokenExpectation = expectation(description: "refreshing access token")
let credentialsDelegateSpy = CredentialsDelegateSpy(expectation: refreshAccessTokenExpectation)

Expand Down

0 comments on commit cdcd03f

Please sign in to comment.