Skip to content

Commit

Permalink
Iwa timeoutfix and newrelease (#153)
Browse files Browse the repository at this point in the history
* IWA Timeout update

* log warning

* Update changelog and references to 0.5.3

* Update README to default to 0.5.3

* update test to new IWA Timeout

* Updating logging condition
  • Loading branch information
melindajohnson authored Sep 28, 2022
1 parent 6fd773b commit 3b0bfd3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
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).

## [0.5.3] - 2022-09-28
### Fixed
- Increase IWA Timeout to 15 second and log WS-Trust endpoint error

## [0.5.2] - 2022-09-28
### Fixed
- Option `--resource` is not needed if option `--scope` is provided.
Expand Down Expand Up @@ -73,7 +77,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial project release.

[Unreleased]: https://github.com/AzureAD/microsoft-authentication-cli/compare/0.5.2...HEAD
[Unreleased]: https://github.com/AzureAD/microsoft-authentication-cli/compare/0.5.3...HEAD
[0.5.3]: https://github.com/AzureAD/microsoft-authentication-cli/compare/0.5.2...0.5.3
[0.5.2]: https://github.com/AzureAD/microsoft-authentication-cli/compare/0.5.1...0.5.2
[0.5.1]: https://github.com/AzureAD/microsoft-authentication-cli/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/AzureAD/microsoft-authentication-cli/compare/0.4.0...0.5.0
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Microsoft Authentication CLI

[![Tests](https://shields.io/github/workflow/status/AzureAD/microsoft-authentication-cli/Build%20and%20Test/main?style=for-the-badge&logo=github)](https://github.com/AzureAD/microsoft-authentication-cli/actions/workflows/dotnet-test.yml)
[![Release](https://shields.io/github/v/release/AzureAD/microsoft-authentication-cli?display_name=tag&include_prereleases&sort=semver&style=for-the-badge&logo=github)](https://github.com/AzureAD/microsoft-authentication-cli/releases/tag/0.5.2)
![GitHub release (latest by SemVer)](https://img.shields.io/github/downloads/azuread/microsoft-authentication-cli/0.5.2/total?logo=github&style=for-the-badge&color=blue)
[![Release](https://shields.io/github/v/release/AzureAD/microsoft-authentication-cli?display_name=tag&include_prereleases&sort=semver&style=for-the-badge&logo=github)](https://github.com/AzureAD/microsoft-authentication-cli/releases/tag/0.5.3)
![GitHub release (latest by SemVer)](https://img.shields.io/github/downloads/azuread/microsoft-authentication-cli/0.5.3/total?logo=github&style=for-the-badge&color=blue)
[![License](https://shields.io/badge/license-MIT-purple?style=for-the-badge)](./LICENSE.txt)

---
Expand Down Expand Up @@ -34,17 +34,17 @@ provide a means of downloading the latest release, so you **must** specify your
To install the application, run

```powershell
# 0.5.2 is an example. See https://github.com/AzureAD/microsoft-authentication-cli/releases for the latest.
$env:AZUREAUTH_VERSION = '0.5.2'
# 0.5.3 is an example. See https://github.com/AzureAD/microsoft-authentication-cli/releases for the latest.
$env:AZUREAUTH_VERSION = '0.5.3'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
iex "& { $(irm https://raw.githubusercontent.com/AzureAD/microsoft-authentication-cli/${env:AZUREAUTH_VERSION}/install/install.ps1) } -Verbose"
```

Or, if you want a method more resilient to failure than `Invoke-Expression`, run

```powershell
# 0.5.2 is an example. See https://github.com/AzureAD/microsoft-authentication-cli/releases for the latest.
$env:AZUREAUTH_VERSION = '0.5.2'
# 0.5.3 is an example. See https://github.com/AzureAD/microsoft-authentication-cli/releases for the latest.
$env:AZUREAUTH_VERSION = '0.5.3'
$script = "${env:TEMP}\install.ps1"
$url = "https://raw.githubusercontent.com/AzureAD/microsoft-authentication-cli/${env:AZUREAUTH_VERSION}/install/install.ps1"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Expand All @@ -64,8 +64,8 @@ release, so you **must** specify your desired version via the `$AZUREAUTH_VERSIO
To install the application, run

```bash
# 0.5.2 is an example. See https://github.com/AzureAD/microsoft-authentication-cli/releases for the latest.
export AZUREAUTH_VERSION='0.5.2'
# 0.5.3 is an example. See https://github.com/AzureAD/microsoft-authentication-cli/releases for the latest.
export AZUREAUTH_VERSION='0.5.3'
curl -sL https://raw.githubusercontent.com/AzureAD/microsoft-authentication-cli/$AZUREAUTH_VERSION/install/install.sh | sh
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public async Task GetTokenSilent_OperationCanceledException()
authFlowResult.TokenResult.Should().Be(null);
authFlowResult.Errors.Should().HaveCount(2);
authFlowResult.Errors[0].Should().BeOfType(typeof(AuthenticationTimeoutException));
authFlowResult.Errors[0].Message.Should().Be("Get Token Silent timed out after 00:00:06");
authFlowResult.Errors[0].Message.Should().Be("Get Token Silent timed out after 00:00:15");
authFlowResult.Errors[1].Should().BeOfType(typeof(NullTokenResultException));
authFlowResult.AuthFlowName.Should().Be("IntegratedWindowsAuthentication");
}
Expand Down
6 changes: 5 additions & 1 deletion src/MSALWrapper/AuthFlow/IntegratedWindowsAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class IntegratedWindowsAuthentication : IAuthFlow
/// <summary>
/// The integrated windows auth flow timeout.
/// </summary>
private TimeSpan integratedWindowsAuthTimeout = TimeSpan.FromSeconds(6);
private TimeSpan integratedWindowsAuthTimeout = TimeSpan.FromSeconds(15);
#endregion

/// <summary>
Expand Down Expand Up @@ -109,6 +109,10 @@ public async Task<AuthFlowResult> GetTokenAsync()
{
this.logger.LogWarning($"Msal Client Exception! (Not expected)\n{ex.Message}");
this.errors.Add(ex);
if (ex.Message.Contains("WS-Trust endpoint not found"))
{
this.logger.LogWarning($"IWA only works on Corp Net, please turn on VPN.");
}
}
catch (NullReferenceException ex)
{
Expand Down

0 comments on commit 3b0bfd3

Please sign in to comment.