@@ -62,8 +62,8 @@ final class MSALNativeAuthUserAccountEndToEndTests: MSALNativeAuthEndToEndPasswo
62
62
XCTAssertEqual ( signInDelegateSpy. result? . account. username, username)
63
63
}
64
64
65
- // Sign in with username and password to get access token and force refresh with existing scopes
66
- func test_signInAndForceRefreshWithExistingScopesSucceeds ( ) async throws {
65
+ // Sign in with username and password to get access token and force refresh with access token not linked to client Id
66
+ func test_signInAndForceRefreshWithNotConfiguredScopes ( ) async throws {
67
67
#if os(macOS)
68
68
throw XCTSkip ( " Bundle id for macOS is not added to the client id, test is not needed on both iOS and macOS " )
69
69
#endif
@@ -83,38 +83,6 @@ final class MSALNativeAuthUserAccountEndToEndTests: MSALNativeAuthEndToEndPasswo
83
83
XCTAssertNotNil ( signInDelegateSpy. result? . idToken)
84
84
XCTAssertEqual ( signInDelegateSpy. result? . account. username, username)
85
85
86
- let previousIdToken = signInDelegateSpy. result? . idToken
87
- let refreshAccessTokenExpectation = expectation ( description: " refreshing access token " )
88
- let credentialsDelegateSpy = CredentialsDelegateSpy ( expectation: refreshAccessTokenExpectation)
89
-
90
- signInDelegateSpy. result? . getAccessToken ( scopes: [ " User.Read " ] , forceRefresh: true , delegate: credentialsDelegateSpy)
91
-
92
- await fulfillment ( of: [ refreshAccessTokenExpectation] )
93
-
94
- XCTAssertTrue ( credentialsDelegateSpy. onAccessTokenRetrieveCompletedCalled)
95
- XCTAssertNotNil ( credentialsDelegateSpy. result? . accessToken)
96
- XCTAssertNotEqual ( previousIdToken, signInDelegateSpy. result? . idToken)
97
- XCTAssertEqual ( signInDelegateSpy. result? . account. username, username)
98
- }
99
-
100
- // Sign in with username and password to get access token and force refresh with different scopes
101
- func test_signInAndForceRefreshWithDifferentScopesFails( ) async throws {
102
- guard let sut = initialisePublicClientApplication ( ) , let username = retrieveUsernameForSignInUsernameAndPassword ( ) , let password = await retrievePasswordForSignInUsername ( ) else {
103
- XCTFail ( " Missing information " )
104
- return
105
- }
106
-
107
- let signInExpectation = expectation ( description: " signing in " )
108
- let signInDelegateSpy = SignInPasswordStartDelegateSpy ( expectation: signInExpectation)
109
-
110
- sut. signIn ( username: username, password: password, correlationId: correlationId, delegate: signInDelegateSpy)
111
-
112
- await fulfillment ( of: [ signInExpectation] )
113
-
114
- XCTAssertTrue ( signInDelegateSpy. onSignInCompletedCalled)
115
- XCTAssertNotNil ( signInDelegateSpy. result? . idToken)
116
- XCTAssertEqual ( signInDelegateSpy. result? . account. username, username)
117
-
118
86
let refreshAccessTokenExpectation = expectation ( description: " refreshing access token " )
119
87
let credentialsDelegateSpy = CredentialsDelegateSpy ( expectation: refreshAccessTokenExpectation)
120
88
0 commit comments