Skip to content

Commit 8dca57a

Browse files
authored
Merge pull request #2766 from AzureAD/release/2.6.0
Release 2.6.0
2 parents b223452 + 20bb1c5 commit 8dca57a

File tree

11 files changed

+80
-14
lines changed

11 files changed

+80
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [2.6.0]
2+
* Support domain_hint param #2759
3+
14
## [2.5.1]
25
* Allow duna external idp on MacOs
36

MSAL/IdentityCore

MSAL/src/MSALPublicClientApplication.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,15 +1039,17 @@ - (void)acquireTokenWithParameters:(MSALInteractiveTokenParameters *)parameters
10391039

10401040
// Extra parameters to be added to the /authorize endpoint.
10411041
msidParams.extraAuthorizeURLQueryParameters = self.internalConfig.extraQueryParameters.extraAuthorizeURLQueryParameters;
1042+
NSMutableDictionary *extraAuthorizeURLQueryParameters = [msidParams.extraAuthorizeURLQueryParameters mutableCopy];
10421043

10431044
// Setup QR+PIN accelerated experience if configured
10441045
if (parameters.preferredAuthMethod == MSALPreferredAuthMethodQRPIN)
10451046
{
1046-
NSMutableDictionary *extraAuthorizeURLQueryParameters = [msidParams.extraAuthorizeURLQueryParameters mutableCopy];
10471047
[extraAuthorizeURLQueryParameters setObject:MSID_PREFERRED_AUTH_METHOD_QR_PIN forKey:MSID_PREFERRED_AUTH_METHOD_KEY];
1048-
msidParams.extraAuthorizeURLQueryParameters = extraAuthorizeURLQueryParameters;
10491048
}
10501049

1050+
extraAuthorizeURLQueryParameters[MSID_DOMAIN_HINT_KEY] = parameters.domainHint;
1051+
msidParams.extraAuthorizeURLQueryParameters = extraAuthorizeURLQueryParameters;
1052+
10511053
// Extra parameters to be added to the /token endpoint.
10521054
msidParams.extraTokenRequestParameters = self.internalConfig.extraQueryParameters.extraTokenURLParameters;
10531055

MSAL/src/native_auth/public/state_machine/state/JITStates+Internal.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ extension RegisterStrongAuthBaseState {
2626
func requestChallengeInternal(authMethod: MSALAuthMethod,
2727
verificationContact: String) async -> MSALNativeAuthJITControlling.JITRequestChallengeControllerResponse {
2828
let context = MSALNativeAuthRequestContext(correlationId: correlationId)
29-
MSALNativeAuthLogger.log(level: .warning, context: context, format: MSALNativeAuthLogMessage.privatePreviewLog)
3029
MSALNativeAuthLogger.log(level: .info, context: context, format: "RegisterStrongAuth, Request Challenge")
3130
if !inputValidator.isInputValid(verificationContact) {
3231
MSALNativeAuthLogger.log(level: .error, context: context, format: "RegisterStrongAuth, Request Challenge - invalid verification contact")
@@ -49,7 +48,6 @@ extension RegisterStrongAuthVerificationRequiredState {
4948

5049
func submitChallengeInternal(challenge: String) async -> MSALNativeAuthJITControlling.JITSubmitChallengeControllerResponse {
5150
let context = MSALNativeAuthRequestContext(correlationId: correlationId)
52-
MSALNativeAuthLogger.log(level: .warning, context: context, format: MSALNativeAuthLogMessage.privatePreviewLog)
5351
MSALNativeAuthLogger.log(level: .info, context: context, format: "RegisterStrongAuth, Submit Challenge")
5452
guard inputValidator.isInputValid(challenge) else {
5553
MSALNativeAuthLogger.log(level: .error, context: context, format: "RegisterStrongAuth, invalid challenge")

MSAL/src/native_auth/public/state_machine/state/JITStates.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public class RegisterStrongAuthBaseState: MSALNativeAuthBaseState {
6666
public class RegisterStrongAuthState: RegisterStrongAuthBaseState {
6767

6868
/// Requests the server to send the challenge to the default authentication method.
69-
/// - Warning: ⚠️ this API is experimental. It may be changed in the future without notice. Do not use in production applications.
7069
/// - Parameters:
7170
/// - parameters: Parameters used to challenge an authentication method
7271
/// - delegate: Delegate that receives callbacks for the operation.
@@ -90,7 +89,6 @@ public class RegisterStrongAuthVerificationRequiredState: RegisterStrongAuthBase
9089
}
9190

9291
/// Submits the challenge to verify the authentication method selected.
93-
/// - Warning: ⚠️ this API is experimental. It may be changed in the future without notice. Do not use in production applications.
9492
/// - Parameters:
9593
/// - challenge: Verification challenge that the user supplies.
9694
/// - delegate: Delegate that receives callbacks for the operation.
@@ -108,7 +106,6 @@ public class RegisterStrongAuthVerificationRequiredState: RegisterStrongAuthBase
108106
}
109107

110108
/// Requests the server to send the challenge to the default authentication method.
111-
/// - Warning: ⚠️ this API is experimental. It may be changed in the future without notice. Do not use in production applications.
112109
/// - Parameters:
113110
/// - parameters: Parameters used to challenge an authentication method
114111
/// - delegate: Delegate that receives callbacks for the operation.

MSAL/src/native_auth/public/state_machine/state/MFAStates+Internal.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import Foundation
2727
extension MFABaseState {
2828
func requestChallengeInternal(authMethod: MSALAuthMethod) async -> MSALNativeAuthMFAControlling.MFARequestChallengeControllerResponse {
2929
let context = MSALNativeAuthRequestContext(correlationId: correlationId)
30-
MSALNativeAuthLogger.log(level: .warning, context: context, format: MSALNativeAuthLogMessage.privatePreviewLog)
3130
MSALNativeAuthLogger.log(level: .info, context: context, format: "MFA, request challenge")
3231
return await controller.requestChallenge(
3332
continuationToken: continuationToken,
@@ -42,7 +41,6 @@ extension MFABaseState {
4241
extension MFARequiredState {
4342
func submitChallengeInternal(challenge: String) async -> MSALNativeAuthMFAControlling.MFASubmitChallengeControllerResponse {
4443
let context = MSALNativeAuthRequestContext(correlationId: correlationId)
45-
MSALNativeAuthLogger.log(level: .warning, context: context, format: MSALNativeAuthLogMessage.privatePreviewLog)
4644
MSALNativeAuthLogger.log(level: .info, context: context, format: "MFA, submit challenge")
4745
guard inputValidator.isInputValid(challenge) else {
4846
MSALNativeAuthLogger.log(level: .error, context: context, format: "MFA, invalid challenge")

MSAL/src/native_auth/public/state_machine/state/MFAStates.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ import Foundation
7373
public class AwaitingMFAState: MFABaseState {
7474

7575
/// Requests the server to send the challenge to the default authentication method.
76-
/// - Warning: ⚠️ this API is experimental. It may be changed in the future without notice. Do not use in production applications.
7776
/// - Parameter authMethod: The authentication method you want to use for sending the challenge
7877
/// - Parameter delegate: Delegate that receives callbacks for the operation.
7978
public func requestChallenge(authMethod: MSALAuthMethod, delegate: MFARequestChallengeDelegate) {
@@ -104,7 +103,6 @@ public class MFARequiredState: MFABaseState {
104103
}
105104

106105
/// Requests the server to send the challenge to the specified auth method or the default one.
107-
/// - Warning: ⚠️ this API is experimental. It may be changed in the future without notice. Do not use in production applications.
108106
/// - Parameters:
109107
/// - authMethod: The authentication method you want to use for sending the challenge
110108
/// - delegate: Delegate that receives callbacks for the operation.
@@ -113,7 +111,6 @@ public class MFARequiredState: MFABaseState {
113111
}
114112

115113
/// Submits the MFA challenge to the server for verification.
116-
/// - Warning: ⚠️ this API is experimental. It may be changed in the future without notice. Do not use in production applications.
117114
/// - Parameters:
118115
/// - challenge: Verification challenge that the user supplies.
119116
/// - delegate: Delegate that receives callbacks for the operation.

MSAL/src/public/MSALInteractiveTokenParameters.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ NS_ASSUME_NONNULL_BEGIN
5656
*/
5757
@property (nonatomic, nullable) NSString *loginHint;
5858

59+
/**
60+
The domain hint can be used to skip directly to the sign in page of the specified identity provider,
61+
instead of having the user make a selection among the list of available identity providers.
62+
*/
63+
@property (nonatomic, nullable) NSString *domainHint;
64+
5965
/**
6066
Permissions you want the account to consent to in the same
6167
authentication flow, but won't be included in the returned

MSAL/test/app/ios/MSALTestAppCacheViewController.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#import "MSIDMetadataCache.h"
6363
#import "MSIDAccountMetadataCacheItem.h"
6464
#import "MSIDAccountMetadataCacheKey.h"
65+
#import "MSIDBoundRefreshToken.h"
6566

6667
#define BAD_REFRESH_TOKEN @"bad-refresh-token"
6768
#define APP_METADATA @"App-Metadata"
@@ -166,6 +167,7 @@ - (void)deleteToken:(MSIDBaseToken *)token
166167
{
167168
case MSIDFamilyRefreshTokenType:
168169
case MSIDRefreshTokenType:
170+
case MSIDBoundRefreshTokenType:
169171
{
170172
if ([token isKindOfClass:[MSIDLegacyRefreshToken class]])
171173
{
@@ -485,6 +487,20 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
485487
}
486488
break;
487489
}
490+
case MSIDBoundRefreshTokenType:
491+
{
492+
MSIDBoundRefreshToken *bart = (MSIDBoundRefreshToken *) token;
493+
494+
cell.textLabel.text = [NSString stringWithFormat:@"BoundRefreshToken : %@, FamilyId : %@", bart.clientId, bart.familyId ? bart.familyId : @"0"];
495+
cell.detailTextLabel.text = [NSString stringWithFormat:@"Client_Id: %@", bart.clientId];
496+
497+
if ([bart.refreshToken isEqualToString:BAD_REFRESH_TOKEN])
498+
{
499+
cell.textLabel.textColor = [UIColor orangeColor];
500+
cell.detailTextLabel.text = [NSString stringWithFormat:@"Client_Id : %@", bart.clientId];
501+
}
502+
break;
503+
}
488504
case MSIDAccessTokenType:
489505
{
490506
MSIDAccessToken *accessToken = (MSIDAccessToken *) token;
@@ -589,6 +605,7 @@ - (UISwipeActionsConfiguration *)tableView:(__unused UITableView *)tableView tra
589605
{
590606
case MSIDFamilyRefreshTokenType:
591607
case MSIDRefreshTokenType:
608+
case MSIDBoundRefreshTokenType:
592609
{
593610
if ([token isKindOfClass:[MSIDLegacyRefreshToken class]])
594611
{

MSAL/test/app/ios/MSALTestAppSettingsViewController.m

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#import "MSIDWorkPlaceJoinUtil.h"
3535
#import "MSALPublicClientApplicationConfig.h"
3636
#import "MSALCacheConfig.h"
37+
#import "MSIDBartFeatureUtil.h"
3738

3839
static NSArray* s_profileRows = nil;
3940
static NSArray* s_deviceRows = nil;
@@ -82,6 +83,7 @@ @implementation MSALTestAppSettingsViewController
8283

8384
NSArray* _profileRows;
8485
NSArray* _deviceRows;
86+
NSArray* _bartSettingsRows;
8587
}
8688

8789
- (id)init
@@ -171,6 +173,27 @@ - (void)viewWillAppear:(BOOL)animated
171173
[MSALTestAppSettingsRow rowWithTitle:@"Device_Info - Device Id" value:^NSString *{ return aadDeviceIdentifier; }],
172174
[MSALTestAppSettingsRow rowWithTitle:@"Device_Info - Tenant Id" value:^NSString *{ return tenantIdentifier; }]];
173175

176+
MSALTestAppSettingsRow* toggleRow = [MSALTestAppSettingsRow rowWithTitle:@"Request bound app refresh tokens?"];
177+
toggleRow.valueBlock = ^NSString *{
178+
// You can replace this with actual toggle state logic
179+
BOOL isEnabled = [[MSIDBartFeatureUtil sharedInstance] isBartFeatureEnabled];
180+
return isEnabled ? @"YES" : @"NO";
181+
};
182+
__weak typeof(self) weakSelf = self;
183+
toggleRow.action = ^{
184+
typeof(self) strongSelf = weakSelf;
185+
if (!strongSelf) return;
186+
187+
// Toggle the setting
188+
BOOL currentState = [[MSIDBartFeatureUtil sharedInstance] isBartFeatureEnabled];
189+
[[MSIDBartFeatureUtil sharedInstance] setBartSupportInAppCache:!currentState];
190+
[strongSelf->_tableView reloadData];
191+
};
192+
193+
_bartSettingsRows = @[
194+
toggleRow
195+
];
196+
174197
self.navigationController.navigationBarHidden = YES;
175198

176199
[_tableView reloadData];
@@ -184,14 +207,16 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
184207
return _profileRows.count;
185208
if (section == 1)
186209
return _deviceRows.count;
210+
if (section == 2)
211+
return _bartSettingsRows.count;
187212

188213
return 0;
189214
}
190215

191216
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
192217
{
193218
(void)tableView;
194-
return 2;
219+
return 3;
195220
}
196221

197222
- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
@@ -201,6 +226,8 @@ - (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSectio
201226
return @"Authentication Settings";
202227
if (section == 1)
203228
return @"Device State";
229+
if (section == 2)
230+
return @"Bound App Refresh Token Settings";
204231

205232
return nil;
206233
}
@@ -221,6 +248,11 @@ - (MSALTestAppSettingsRow*)rowForIndexPath:(NSIndexPath *)indexPath
221248
return _deviceRows[row];
222249
}
223250

251+
if (section == 2)
252+
{
253+
return _bartSettingsRows[row];
254+
}
255+
224256
return nil;
225257
}
226258

0 commit comments

Comments
 (0)