Skip to content

Commit b48916c

Browse files
authored
Merge pull request #2618 from AzureAD/release/2.0.0
Merge Release/2.0.0 back to dev
2 parents 2243942 + 2935d5a commit b48916c

24 files changed

+722
-61
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
## [TBD]
1+
## [2.0.0]
22
* Use a single family refresh token (#2550)
33
* Removed deprecated APIs, including legacy initializers, account management methods and token acquisition methods, and the MSALTelemetry interface (#2577)
44
* Enforced requirement for a valid ParentViewController (with a window) in interactive token requests (#2590)
55
* Removed deprecated methods from native auth public interface (#2588)
66
* Removed the deprecated MSALLogger interface and implementation class (#2591)
77
* Enforced a valid broker-capable redirect URI format for AAD scenarios (#2592)
88
* Merged the MSALAccount (MultiTenantAccount) category into the MSALAccount protocol and removed the MSALAccount+MultiTenantAccount.h (#2594)
9+
* Added [MSAL 2.x Migration Guide](docs/MSAL_2x_Migration_Guide.md) to assist developers in upgrading from MSAL 1.x to 2.x. (#2614)
910

1011
## [1.9.0]
1112
* Add feature flags provider to be controlled from broker (#2540)

MSAL.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MSAL"
3-
s.version = "1.9.0"
3+
s.version = "2.0.0"
44
s.summary = "Microsoft Authentication Library (MSAL) for iOS"
55
s.description = <<-DESC
66
The MSAL library for iOS gives your app the ability to begin using the Microsoft Cloud by supporting Microsoft Azure Active Directory and Microsoft Accounts in a converged experience using industry standard OAuth2 and OpenID Connect. The library also supports Microsoft Azure B2C for those using our hosted identity management service.

MSAL/resources/ios/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.9.0</string>
18+
<string>2.0.0</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

MSAL/resources/mac/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.9.0</string>
18+
<string>2.0.0</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

MSAL/src/MSAL_Internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
//
2626
//------------------------------------------------------------------------------
2727

28-
#define MSAL_VER_HIGH 1
29-
#define MSAL_VER_LOW 9
28+
#define MSAL_VER_HIGH 2
29+
#define MSAL_VER_LOW 0
3030
#define MSAL_VER_PATCH 0
3131

3232
#define STR_HELPER(x) #x

MSAL/src/native_auth/controllers/jit/MSALNativeAuthJITController.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,19 @@ final class MSALNativeAuthJITController: MSALNativeAuthBaseController, MSALNativ
277277
telemetryId: .telemetryApiISignInAfterJIT,
278278
context: context)
279279
switch response.result {
280-
case .success(let account):
280+
case .completed(let account):
281281
return .init(.completed(account), correlationId: context.correlationId(), telemetryUpdate: { [weak self] result in
282282
self?.stopTelemetryEvent(signInEvent, context: context, delegateDispatcherResult: result)
283283
})
284-
case .failure(let error):
284+
case .jitAuthMethodsSelectionRequired(_, _):
285+
return .init(.error(error: .init(type: .generalError,
286+
message: "Unexpected result received when trying to signIn: strong authentication method registration required.",
287+
correlationId: context.correlationId(),
288+
errorCodes: [],
289+
errorUri: nil),
290+
newState: nil),
291+
correlationId: context.correlationId())
292+
case .error(let error):
285293
return .init(.error(error: .init(type: .generalError,
286294
message: error.errorDescription,
287295
correlationId: error.correlationId,

MSAL/src/native_auth/controllers/responses/SignInResults.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ enum SignInVerifyCodeResult {
4646
case completed(MSALNativeAuthUserAccountResult)
4747
case error(error: VerifyCodeError, newState: SignInCodeRequiredState?)
4848
}
49+
50+
enum SignInAfterPreviousFlowResult {
51+
case completed(MSALNativeAuthUserAccountResult)
52+
case jitAuthMethodsSelectionRequired(authMethods: [MSALAuthMethod], newState: RegisterStrongAuthState)
53+
case error(error: MSALNativeAuthError)
54+
}

MSAL/src/native_auth/controllers/sign_in/MSALNativeAuthSignInController.swift

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ final class MSALNativeAuthSignInController: MSALNativeAuthTokenController, MSALN
128128
format: "SignIn after previous flow not available because continuationToken is nil")
129129
let error = SignInAfterSignUpError(message: MSALNativeAuthErrorMessage.signInNotAvailable, correlationId: context.correlationId())
130130
stopTelemetryEvent(telemetryInfo, error: error)
131-
return .init(.failure(error), correlationId: context.correlationId())
131+
return .init(.error(error: error), correlationId: context.correlationId())
132132
}
133133
let scopes = joinScopes(scopes)
134134
guard let request = createTokenRequest(
@@ -141,7 +141,7 @@ final class MSALNativeAuthSignInController: MSALNativeAuthTokenController, MSALN
141141
) else {
142142
let error = SignInAfterSignUpError(correlationId: context.correlationId())
143143
stopTelemetryEvent(telemetryInfo, error: error)
144-
return .init(.failure(error), correlationId: context.correlationId())
144+
return .init(.error(error: error), correlationId: context.correlationId())
145145
}
146146
let response = await performAndValidateTokenRequest(request, context: context)
147147
let result = await handleTokenResponse(response,
@@ -150,56 +150,30 @@ final class MSALNativeAuthSignInController: MSALNativeAuthTokenController, MSALN
150150
telemetryInfo: telemetryInfo)
151151
switch result {
152152
case .success(let accountResult):
153-
return .init(.success(accountResult), correlationId: context.correlationId(), telemetryUpdate: { [weak self] result in
153+
return .init(.completed(accountResult), correlationId: context.correlationId(), telemetryUpdate: { [weak self] result in
154154
self?.stopTelemetryEvent(telemetryInfo.event, context: context, delegateDispatcherResult: result)
155155
})
156156
case .awaitingMFA(_):
157157
let error = SignInAfterSignUpError(correlationId: context.correlationId())
158158
MSALNativeAuthLogger.log(level: .error, context: context, format: "SignIn: received unexpected MFA required API result")
159159
self.stopTelemetryEvent(telemetryInfo.event, context: context, error: error)
160-
return .init(.failure(error), correlationId: context.correlationId())
160+
return .init(.error(error: error), correlationId: context.correlationId())
161161
case .jitAuthMethodsSelectionRequired(let authMethods, let jitRequiredState):
162162
MSALNativeAuthLogger.log(level: .info, context: context, format: "JIT required after sing in after previous flow")
163-
let jitController = createJITController()
164-
guard let authMethod = authMethods.first else {
165-
let error = SignInAfterSignUpError(correlationId: context.correlationId())
166-
MSALNativeAuthLogger.log(level: .error, context: context, format: "JIT required, did not receive any default methods")
167-
self.stopTelemetryEvent(telemetryInfo.event, context: context, error: error)
168-
return .init(.failure(error), correlationId: context.correlationId())
169-
}
170-
let jitChallengeResponse = await jitController.requestJITChallenge(
171-
continuationToken: jitRequiredState.continuationToken,
172-
authMethod: authMethod,
173-
verificationContact: nil,
174-
context: context)
175-
switch jitChallengeResponse.result {
176-
case .completed(let accountResult):
177-
return .init(.success(accountResult), correlationId: context.correlationId(), telemetryUpdate: { [weak self] result in
163+
return .init(
164+
.jitAuthMethodsSelectionRequired(authMethods: authMethods, newState: jitRequiredState),
165+
correlationId: context.correlationId(),
166+
telemetryUpdate: { [weak self] result in
178167
self?.stopTelemetryEvent(telemetryInfo.event, context: context, delegateDispatcherResult: result)
179168
})
180-
case .verificationRequired(_, _, _, _):
181-
let error = SignInAfterSignUpError(correlationId: context.correlationId())
182-
MSALNativeAuthLogger.log(level: .error,
183-
context: context,
184-
format: "Request JIT challenge, received verification required on SignInAfterPreviousFlow")
185-
self.stopTelemetryEvent(telemetryInfo.event, context: context, error: error)
186-
return .init(.failure(error), correlationId: context.correlationId())
187-
case .error(let apiError, _):
188-
let error = SignInAfterSignUpError(correlationId: context.correlationId())
189-
MSALNativeAuthLogger.logPII(level: .error,
190-
context: context,
191-
format: "Request JIT challenge, received invalid response \(MSALLogMask.maskPII(apiError.errorDescription))")
192-
self.stopTelemetryEvent(telemetryInfo.event, context: context, error: error)
193-
return .init(.failure(error), correlationId: context.correlationId())
194-
}
195169
case .error(let error):
196170
let error = SignInAfterSignUpError(
197171
message: error.errorDescription,
198172
correlationId: error.correlationId,
199173
errorCodes: error.errorCodes,
200174
errorUri: error.errorUri
201175
)
202-
return .init(.failure(error), correlationId: context.correlationId())
176+
return .init(.error(error: error), correlationId: context.correlationId())
203177
}
204178
}
205179

MSAL/src/native_auth/controllers/sign_in/MSALNativeAuthSignInControlling.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protocol MSALNativeAuthSignInControlling {
2828

2929
typealias SignInControllerResponse = MSALNativeAuthControllerTelemetryWrapper<SignInStartResult>
3030
typealias SignInAfterPreviousFlowControllerResponse =
31-
MSALNativeAuthControllerTelemetryWrapper<Result<MSALNativeAuthUserAccountResult, MSALNativeAuthError>>
31+
MSALNativeAuthControllerTelemetryWrapper<SignInAfterPreviousFlowResult>
3232
typealias SignInSubmitCodeControllerResponse = MSALNativeAuthControllerTelemetryWrapper<SignInVerifyCodeResult>
3333
typealias SignInSubmitPasswordControllerResponse = MSALNativeAuthControllerTelemetryWrapper<SignInPasswordRequiredResult>
3434
typealias SignInResendCodeControllerResponse = MSALNativeAuthControllerTelemetryWrapper<SignInResendCodeResult>

0 commit comments

Comments
 (0)