Skip to content

Commit

Permalink
Remove IWA from default auth modes. (#415)
Browse files Browse the repository at this point in the history
* Remove IWA from default auth modes.

* Fix unit tests which were expected to break
  • Loading branch information
Haard30 authored Nov 8, 2024
1 parent 82a20c1 commit 7552cc2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Removed
- Removed IWA from default authentcation mode.
### Changed
- Temporarily paused the publishing of Linux binaries.
- Upgrade MSAL from `4.59.1` to `4.65.0`.
Expand Down
2 changes: 1 addition & 1 deletion src/AzureAuth.Test/AuthModeExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void CombinedAuthMode_Allowed()
this.envMock.Setup(e => e.Get(EnvVars.NoUser)).Returns(string.Empty);
this.envMock.Setup(e => e.Get("Corext_NonInteractive")).Returns(string.Empty);

var subject = new[] { AuthMode.IWA, AuthMode.Web, AuthMode.Broker };
var subject = new[] { AuthMode.Web, AuthMode.Broker };

// Act + Assert
subject.Combine().PreventInteractionIfNeeded(this.envMock.Object, this.logger).Should().Be(AuthMode.Default);
Expand Down
2 changes: 1 addition & 1 deletion src/AzureAuth/Commands/CommandAad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class CommandAad
/// </summary>
#if PlatformWindows
public const string AuthModeHelperText = @"Authentication mode. Repeated invocations allowed.
[default: iwa (Integrated Windows Auth), then broker, then web]
[default: broker, then web]
[possible values: all, iwa, broker, web, devicecode]";
#else
public const string AuthModeHelperText = @"Authentication mode. Repeated invocations allowed. [default: web]
Expand Down
9 changes: 2 additions & 7 deletions src/MSALWrapper.Test/AuthFlow/AuthFlowFactoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,37 +111,33 @@ public void Broker_Only()
[Test]
public void Windows10Or11_Defaults()
{
this.MockIsWindows(true);
this.MockIsWindows10Or11(true);

IEnumerable<IAuthFlow> subject = this.Subject(AuthMode.Default);

subject.Should().HaveCount(4);
subject.Should().HaveCount(3);
subject
.Select(a => a.GetType())
.Should()
.ContainInOrder(
typeof(CachedAuth),
typeof(IntegratedWindowsAuthentication),
typeof(Broker),
typeof(Web));
}

[Test]
public void Windows_Defaults()
{
this.MockIsWindows(true);
this.MockIsWindows10Or11(false);

IEnumerable<IAuthFlow> subject = this.Subject(AuthMode.Default);

subject.Should().HaveCount(3);
subject.Should().HaveCount(2);
subject
.Select(a => a.GetType())
.Should()
.ContainInOrder(
typeof(CachedAuth),
typeof(IntegratedWindowsAuthentication),
typeof(Web));
}

Expand All @@ -159,7 +155,6 @@ public void Windows10Or11_All()
.Should()
.ContainInOrder(
typeof(CachedAuth),
typeof(IntegratedWindowsAuthentication),
typeof(Broker),
typeof(Web),
typeof(DeviceCode));
Expand Down
2 changes: 1 addition & 1 deletion src/MSALWrapper.Test/AuthModeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public void AllIsAll()
public void WindowsDefaultModes()
{
var subject = AuthMode.Default;
subject.IsIWA().Should().BeTrue();
subject.IsBroker().Should().BeTrue();
subject.IsWeb().Should().BeTrue();
subject.IsIWA().Should().BeFalse();
subject.IsDeviceCode().Should().BeFalse();
}

Expand Down
2 changes: 1 addition & 1 deletion src/MSALWrapper/AuthMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public enum AuthMode : short
/// <summary>
/// Default auth mode.
/// </summary>
Default = IWA | Broker | Web,
Default = Broker | Web,
#else
/// <summary>
/// All auth modes.
Expand Down

0 comments on commit 7552cc2

Please sign in to comment.