Skip to content

Commit

Permalink
Updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FehintolaObafemi committed Feb 19, 2025
1 parent 551a561 commit 7df1cc0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
<LangVersion>9.0</LangVersion>
<TargetFrameworks>netstandard2.0;net8.0;net472</TargetFrameworks>
<RootNamespace>Microsoft.Graph.PowerShell.Authentication.Core</RootNamespace>
<Version>2.12.0</Version>
<Version>2.25.0</Version>
<!-- Suppress .NET Target Framework Moniker (TFM) Support Build Warnings -->
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Core.Experimental" Version="0.1.0-preview.34" />
<PackageReference Include="Azure.Identity" Version="1.13.0-beta.1" />
<PackageReference Include="Azure.Identity.Broker" Version="1.2.0-beta.1" />
<PackageReference Include="Microsoft.Graph.Core" Version="3.1.14" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.62.0" />
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.62.0" />
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Azure.Identity.Broker" Version="1.2.0" />
<PackageReference Include="Microsoft.Graph.Core" Version="3.2.2" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.67.2" />
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.67.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Authentication/Authentication/Helpers/HttpHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ private static HttpClient GetGraphHttpClient(AzureIdentityAccessTokenProvider au
new NationalCloudHandler(),
new ODataQueryOptionsHandler(),
new HttpVersionHandler(),
//new CompressionHandler(),
new RetryHandler(new RetryHandlerOption{
Delay = requestContext.RetryDelay,
MaxRetry = requestContext.MaxRetry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ Describe 'Connect-MgGraph In Delegated Mode' {

Describe 'Connect-MgGraph In Environment Variable Mode' {
It 'Should throw exception when supported environment variables are not specified' {
{ Connect-MgGraph -EnvironmentVariable -ErrorAction Stop } | Should -Throw -ExpectedMessage "*EnvironmentCredential authentication unavailable*"
{ Connect-MgGraph -EnvironmentVariable -ErrorAction Stop } | Should -Throw -ExpectedMessage "*EnvironmentCredential authentication unavailable. Environment variables are not fully configured*"
}
It 'Should attempt to use configured environment variables' {
{
$Env:AZURE_CLIENT_ID = "Not_Valid"
$Env:AZURE_CLIENT_SECRET = "Not_Valid"
$Env:AZURE_TENANT_ID = "common"
Connect-MgGraph -EnvironmentVariable -ErrorAction Stop
} | Should -Throw -ExpectedMessage "*ClientSecretCredential authentication failed*"
} | Should -Throw -ExpectedMessage "ClientSecretCredential authentication failed: "
}
}

Expand All @@ -95,7 +95,7 @@ Describe 'Connect-MgGraph In App Mode' {
Describe 'Connect-MgGraph Dependency Resolution' {
It 'Should load Mg module side by side with Az module.' {
{ Connect-AzAccount -ApplicationId $RandomClientId -CertificateThumbprint "Invalid" -Tenant "Invalid" -ErrorAction Stop } | Should -Throw -ExpectedMessage "*Could not find tenant id*"
{ Connect-MgGraph -TenantId "thisdomaindoesnotexist.com" -ErrorAction Stop -UseDeviceAuthentication } | Should -Throw -ExpectedMessage "*DeviceCodeCredential authentication failed*"
{ Connect-MgGraph -TenantId "thisdomaindoesnotexist.com" -ErrorAction Stop -UseDeviceAuthentication } | Should -Throw -ExpectedMessage "DeviceCodeCredential authentication failed: "
}
}

Expand Down
16 changes: 7 additions & 9 deletions src/Authentication/docs/Connect-MgGraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,38 @@ Microsoft Graph PowerShell supports two types of authentication: delegated and a
```
Connect-MgGraph [[-Scopes] <String[]>] [[-ClientId] <String>] [-TenantId <String>]
[-ContextScope <ContextScope>] [-Environment <String>] [-UseDeviceCode] [-ClientTimeout <Double>] [-NoWelcome]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
[<CommonParameters>]
```

### AppCertificateParameterSet
```
Connect-MgGraph [-ClientId] <String> [[-CertificateSubjectName] <String>] [[-CertificateThumbprint] <String>]
[-SendCertificateChain <Boolean>] [-Certificate <X509Certificate2>] [-TenantId <String>]
[-ContextScope <ContextScope>] [-Environment <String>] [-ClientTimeout <Double>] [-NoWelcome]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
[-Certificate <X509Certificate2>] [-TenantId <String>] [-ContextScope <ContextScope>] [-Environment <String>]
[-ClientTimeout <Double>] [-NoWelcome] [<CommonParameters>]
```

### IdentityParameterSet
```
Connect-MgGraph [[-ClientId] <String>] [-ContextScope <ContextScope>] [-Environment <String>]
[-ClientTimeout <Double>] [-Identity] [-NoWelcome] [-ProgressAction <ActionPreference>] [<CommonParameters>]
[-ClientTimeout <Double>] [-Identity] [-NoWelcome] [<CommonParameters>]
```

### AppSecretCredentialParameterSet
```
Connect-MgGraph [-ClientSecretCredential <PSCredential>] [-TenantId <String>] [-ContextScope <ContextScope>]
[-Environment <String>] [-ClientTimeout <Double>] [-NoWelcome] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
[-Environment <String>] [-ClientTimeout <Double>] [-NoWelcome] [<CommonParameters>]
```

### AccessTokenParameterSet
```
Connect-MgGraph [-AccessToken] <SecureString> [-Environment <String>] [-ClientTimeout <Double>] [-NoWelcome]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
[<CommonParameters>]
```

### EnvironmentVariableParameterSet
```
Connect-MgGraph [-ContextScope <ContextScope>] [-Environment <String>] [-ClientTimeout <Double>]
[-EnvironmentVariable] [-NoWelcome] [-ProgressAction <ActionPreference>] [<CommonParameters>]
[-EnvironmentVariable] [-NoWelcome] [<CommonParameters>]
```

## DESCRIPTION
Expand Down

0 comments on commit 7df1cc0

Please sign in to comment.