diff --git a/src/Authentication/Authentication.Core/Interfaces/IAuthContext.cs b/src/Authentication/Authentication.Core/Interfaces/IAuthContext.cs index d7060de2a46..9b75ce16186 100644 --- a/src/Authentication/Authentication.Core/Interfaces/IAuthContext.cs +++ b/src/Authentication/Authentication.Core/Interfaces/IAuthContext.cs @@ -45,6 +45,7 @@ public interface IAuthContext string Environment { get; set; } string AppName { get; set; } string Account { get; set; } + string UserPrincipalName { get; set; } string CertificateThumbprint { get; set; } string CertificateSubjectName { get; set; } bool SendCertificateChain { get; set; } diff --git a/src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs b/src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs index 71919594c4a..cca8d5ac98a 100644 --- a/src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs +++ b/src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs @@ -119,6 +119,7 @@ private static async Task GetInteractiveBrowserCre interactiveOptions.TenantId = authContext.TenantId ?? "common"; interactiveOptions.AuthorityHost = new Uri(GetAuthorityUrl(authContext)); interactiveOptions.TokenCachePersistenceOptions = GetTokenCachePersistenceOptions(authContext); + interactiveOptions.LoginHint = authContext.UserPrincipalName; if (!File.Exists(Constants.AuthRecordPath)) { diff --git a/src/Authentication/Authentication.Test/Microsoft.Graph.Authentication.Test.csproj b/src/Authentication/Authentication.Test/Microsoft.Graph.Authentication.Test.csproj index f40643cfdb6..793399f261d 100644 --- a/src/Authentication/Authentication.Test/Microsoft.Graph.Authentication.Test.csproj +++ b/src/Authentication/Authentication.Test/Microsoft.Graph.Authentication.Test.csproj @@ -2,7 +2,7 @@ net8.0;net472 false - 2.25.0 + 2.30.0 diff --git a/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs b/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs index 3fd26ccb594..1af0806cb70 100644 --- a/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs +++ b/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs @@ -99,6 +99,10 @@ public class ConnectMgGraph : PSCmdlet, IModuleAssemblyInitializer, IModuleAssem [Alias("ManagedIdentity", "ManagedServiceIdentity", "MSI")] public SwitchParameter Identity { get; set; } + [Parameter(ParameterSetName = Constants.UserParameterSet, Mandatory = false, HelpMessage = HelpMessages.UserPrincipalName)] + [Alias("UPN")] + public string UserPrincipalName { get; set; } + [Parameter(ParameterSetName = Constants.EnvironmentVariableParameterSet, Mandatory = false, HelpMessage = HelpMessages.EnvironmentVariable)] public SwitchParameter EnvironmentVariable { get; set; } @@ -182,6 +186,7 @@ private async Task ProcessRecordAsync() if (MyInvocation.BoundParameters.ContainsKey(nameof(ClientId))) authContext.ClientId = ClientId; authContext.AuthType = AuthenticationType.Delegated; + authContext.UserPrincipalName = UserPrincipalName; string[] processedScopes = ProcessScopes(Scopes); authContext.Scopes = !processedScopes.Any() ? new[] { "User.Read" } : processedScopes; if (RuntimeInformation.OSDescription.ContainsValue("WSL", StringComparison.InvariantCulture)) diff --git a/src/Authentication/Authentication/Constants.cs b/src/Authentication/Authentication/Constants.cs index 47924df7842..6a0c246a84a 100644 --- a/src/Authentication/Authentication/Constants.cs +++ b/src/Authentication/Authentication/Constants.cs @@ -46,6 +46,7 @@ public static class HelpMessages public const string ClientTimeout = "Sets the HTTP client timeout in seconds."; public const string NoWelcome = "Hides the welcome message."; public const string Identity = "Login using a Managed Identity."; + public const string UserPrincipalName = "Specifies the account that you want to use to connect in order to skip the connection prompt."; public const string EnvironmentVariable = "Allows for authentication using environment variables configured on the host machine. See https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#environment-variables."; public const string ManagedIdentityClientId = "The client id to authenticate for a user assigned managed identity. For more information on user assigned managed identities see: https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview#how-a-user-assigned-managed-identity-works-with-an-azure-vmId. To use the SystemAssigned identity, leave this field blank."; } diff --git a/src/Authentication/Authentication/Microsoft.Graph.Authentication-help.xml b/src/Authentication/Authentication/Microsoft.Graph.Authentication-help.xml index 3c8bd5db0d1..e05ebc523a3 100644 --- a/src/Authentication/Authentication/Microsoft.Graph.Authentication-help.xml +++ b/src/Authentication/Authentication/Microsoft.Graph.Authentication-help.xml @@ -419,8 +419,7 @@ Get-MgUserActivityHistoryItem CrossDeviceExperiences GET /users All - To return all possible permissions rather than just those that match the SearchString parameter, specify the All parameter. The -All parameter may also be used with the PermissionType to enumerate all applicaition permissions or all delegated permissions. + To return all possible permissions rather than just those that match the SearchString parameter, specify the All parameter. The All parameter may also be used with the PermissionType to enumerate all applicaition permissions or all delegated permissions. SwitchParameter @@ -431,14 +430,7 @@ All parameter may also be used with the PermissionType to enumerate all applicai Online - Specify the Online parameter in addition to SearchString to force Find-MgGraphPermission to update its set of permissions -by requesting the latest permissions data from Microsoft Graph itself before searching for the permissions specified the -SearchString parameter. This ensures that Find-MgGraphPermission returns the most accurate search results as new permissions -are added to Microsoft Graph for new APIs. The command uses the existing access to Microsoft Graph as enabled by a previous -invocation of the Connect-MgGraph command to issue the request for updated permissions. If your current connection does not -already have access to read this data from Microsoft Graph or if there is no network connectivity to Microsoft Graph, the command will fail. -If the command is successful in updating the set of permissions prior to searching for permissions, Find-MgGraphPermission will -continue to use the updated list for all future invocations of the command even if they do not specify the Online parameter + Specify the Online parameter in addition to SearchString to force Find-MgGraphPermission to update its set of permissions by requesting the latest permissions data from Microsoft Graph itself before searching for the permissions specified the SearchString parameter. This ensures that Find-MgGraphPermission returns the most accurate search results as new permissions are added to Microsoft Graph for new APIs. The command uses the existing access to Microsoft Graph as enabled by a previous invocation of the Connect-MgGraph command to issue the request for updated permissions. If your current connection does not already have access to read this data from Microsoft Graph or if there is no network connectivity to Microsoft Graph, the command will fail. If the command is successful in updating the set of permissions prior to searching for permissions, Find-MgGraphPermission will continue to use the updated list for all future invocations of the command even if they do not specify the Online parameter SwitchParameter @@ -449,9 +441,7 @@ continue to use the updated list for all future invocations of the command even PermissionType - Specify the PermissionType to determine whether application permissions, delegated permisisons, or both are returned by -Find-MgGraphPermission. By default, the value of this parameter is Any, which includes both delegated and application permissions. -Other valid values for PermissionType are Application and Delegated to return those specify types of permissions. + Specify the PermissionType to determine whether application permissions, delegated permisisons, or both are returned by Find-MgGraphPermission. By default, the value of this parameter is Any, which includes both delegated and application permissions. Other valid values for PermissionType are Application and Delegated to return those specify types of permissions. String @@ -478,10 +468,7 @@ Other valid values for PermissionType are Application and Delegated to return th SearchString - The SearchString parameter allows you to specify a string such as 'user' or 'mail' that represents the subject or domain -of the permission you're searching for. Since permissions usually have names such as 'User.Read' or 'Mail.ReadWrite', the -command uses the SearchString parameter to return all permissions that contain the value specified for SearchString in the -name of the permission. + The SearchString parameter allows you to specify a string such as 'user' or 'mail' that represents the subject or domain of the permission you're searching for. Since permissions usually have names such as 'User.Read' or 'Mail.ReadWrite', the command uses the SearchString parameter to return all permissions that contain the value specified for SearchString in the name of the permission. String @@ -504,14 +491,7 @@ name of the permission. Online - Specify the Online parameter in addition to SearchString to force Find-MgGraphPermission to update its set of permissions -by requesting the latest permissions data from Microsoft Graph itself before searching for the permissions specified the -SearchString parameter. This ensures that Find-MgGraphPermission returns the most accurate search results as new permissions -are added to Microsoft Graph for new APIs. The command uses the existing access to Microsoft Graph as enabled by a previous -invocation of the Connect-MgGraph command to issue the request for updated permissions. If your current connection does not -already have access to read this data from Microsoft Graph or if there is no network connectivity to Microsoft Graph, the command will fail. -If the command is successful in updating the set of permissions prior to searching for permissions, Find-MgGraphPermission will -continue to use the updated list for all future invocations of the command even if they do not specify the Online parameter + Specify the Online parameter in addition to SearchString to force Find-MgGraphPermission to update its set of permissions by requesting the latest permissions data from Microsoft Graph itself before searching for the permissions specified the SearchString parameter. This ensures that Find-MgGraphPermission returns the most accurate search results as new permissions are added to Microsoft Graph for new APIs. The command uses the existing access to Microsoft Graph as enabled by a previous invocation of the Connect-MgGraph command to issue the request for updated permissions. If your current connection does not already have access to read this data from Microsoft Graph or if there is no network connectivity to Microsoft Graph, the command will fail. If the command is successful in updating the set of permissions prior to searching for permissions, Find-MgGraphPermission will continue to use the updated list for all future invocations of the command even if they do not specify the Online parameter SwitchParameter @@ -522,9 +502,7 @@ continue to use the updated list for all future invocations of the command even PermissionType - Specify the PermissionType to determine whether application permissions, delegated permisisons, or both are returned by -Find-MgGraphPermission. By default, the value of this parameter is Any, which includes both delegated and application permissions. -Other valid values for PermissionType are Application and Delegated to return those specify types of permissions. + Specify the PermissionType to determine whether application permissions, delegated permisisons, or both are returned by Find-MgGraphPermission. By default, the value of this parameter is Any, which includes both delegated and application permissions. Other valid values for PermissionType are Application and Delegated to return those specify types of permissions. String @@ -551,8 +529,7 @@ Other valid values for PermissionType are Application and Delegated to return th All - To return all possible permissions rather than just those that match the SearchString parameter, specify the All parameter. The -All parameter may also be used with the PermissionType to enumerate all applicaition permissions or all delegated permissions. + To return all possible permissions rather than just those that match the SearchString parameter, specify the All parameter. The All parameter may also be used with the PermissionType to enumerate all applicaition permissions or all delegated permissions. SwitchParameter @@ -576,14 +553,7 @@ All parameter may also be used with the PermissionType to enumerate all applicai Online - Specify the Online parameter in addition to SearchString to force Find-MgGraphPermission to update its set of permissions -by requesting the latest permissions data from Microsoft Graph itself before searching for the permissions specified the -SearchString parameter. This ensures that Find-MgGraphPermission returns the most accurate search results as new permissions -are added to Microsoft Graph for new APIs. The command uses the existing access to Microsoft Graph as enabled by a previous -invocation of the Connect-MgGraph command to issue the request for updated permissions. If your current connection does not -already have access to read this data from Microsoft Graph or if there is no network connectivity to Microsoft Graph, the command will fail. -If the command is successful in updating the set of permissions prior to searching for permissions, Find-MgGraphPermission will -continue to use the updated list for all future invocations of the command even if they do not specify the Online parameter + Specify the Online parameter in addition to SearchString to force Find-MgGraphPermission to update its set of permissions by requesting the latest permissions data from Microsoft Graph itself before searching for the permissions specified the SearchString parameter. This ensures that Find-MgGraphPermission returns the most accurate search results as new permissions are added to Microsoft Graph for new APIs. The command uses the existing access to Microsoft Graph as enabled by a previous invocation of the Connect-MgGraph command to issue the request for updated permissions. If your current connection does not already have access to read this data from Microsoft Graph or if there is no network connectivity to Microsoft Graph, the command will fail. If the command is successful in updating the set of permissions prior to searching for permissions, Find-MgGraphPermission will continue to use the updated list for all future invocations of the command even if they do not specify the Online parameter SwitchParameter @@ -595,9 +565,7 @@ continue to use the updated list for all future invocations of the command even PermissionType - Specify the PermissionType to determine whether application permissions, delegated permisisons, or both are returned by -Find-MgGraphPermission. By default, the value of this parameter is Any, which includes both delegated and application permissions. -Other valid values for PermissionType are Application and Delegated to return those specify types of permissions. + Specify the PermissionType to determine whether application permissions, delegated permisisons, or both are returned by Find-MgGraphPermission. By default, the value of this parameter is Any, which includes both delegated and application permissions. Other valid values for PermissionType are Application and Delegated to return those specify types of permissions. String @@ -621,10 +589,7 @@ Other valid values for PermissionType are Application and Delegated to return th SearchString - The SearchString parameter allows you to specify a string such as 'user' or 'mail' that represents the subject or domain -of the permission you're searching for. Since permissions usually have names such as 'User.Read' or 'Mail.ReadWrite', the -command uses the SearchString parameter to return all permissions that contain the value specified for SearchString in the -name of the permission. + The SearchString parameter allows you to specify a string such as 'user' or 'mail' that represents the subject or domain of the permission you're searching for. Since permissions usually have names such as 'User.Read' or 'Mail.ReadWrite', the command uses the SearchString parameter to return all permissions that contain the value specified for SearchString in the name of the permission. String diff --git a/src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj b/src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj index 383f9e88005..f694cfb8b34 100644 --- a/src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj +++ b/src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj @@ -10,7 +10,7 @@ Microsoft.Graph.Authentication.nuspec © Microsoft Corporation. All rights reserved. - 2.6.1 + 2.30.0 true diff --git a/src/Authentication/Authentication/Microsoft.Graph.Authentication.dll-Help.xml b/src/Authentication/Authentication/Microsoft.Graph.Authentication.dll-Help.xml index 5df68dcb554..2101eba2d44 100644 --- a/src/Authentication/Authentication/Microsoft.Graph.Authentication.dll-Help.xml +++ b/src/Authentication/Authentication/Microsoft.Graph.Authentication.dll-Help.xml @@ -6,11 +6,11 @@ Add MgEnvironment - {{ Fill in the Synopsis }} + Adds Microsoft Graph environment to the settings file. - {{ Fill in the Description }} + Adds Microsoft Graph environment to the settings file. @@ -51,6 +51,18 @@ None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Confirm @@ -112,6 +124,18 @@ None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Confirm @@ -164,10 +188,13 @@ - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + ----------- Example 1: Add user defined environment ----------- + PS C:\> Add-MgEnvironment -Name "Canary" -GraphEndpoint "https://canary.graph.microsoft.com" -AzureADEndpoint "https://login.microsoftonline.com" +Name AzureADEndpoint GraphEndpoint Type +---- --------------- ------------- ---- +Canary https://login.microsoftonline.com https://microsoftgraph.com User-defined - {{ Add example description here }} + Adds user defined environment. @@ -240,6 +267,18 @@ False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Connect-MgGraph @@ -342,6 +381,30 @@ False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + + + SendCertificateChain + + Include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication using given certificate. + + Boolean + + Boolean + + + None + TenantId @@ -432,6 +495,18 @@ False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + TenantId @@ -532,6 +607,18 @@ False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Connect-MgGraph @@ -598,6 +685,18 @@ False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + TenantId @@ -675,6 +774,18 @@ False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + @@ -822,6 +933,18 @@ False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Scopes @@ -834,6 +957,18 @@ None + + SendCertificateChain + + Include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication using given certificate. + + Boolean + + Boolean + + + None + TenantId @@ -1002,9 +1137,34 @@ PS C:\> Connect-MgGraph -Environment USGov Disconnect-MgGraph + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + - + + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + + @@ -1061,9 +1221,34 @@ PS C:\> Connect-MgGraph -Environment USGov Get-MgContext + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + - + + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + + @@ -1163,6 +1348,18 @@ User.ReadWrite.All None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + @@ -1178,6 +1375,18 @@ User.ReadWrite.All None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + @@ -1232,18 +1441,43 @@ USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us Get MgGraphOption - {{ Fill in the Synopsis }} + Gets global configurations that apply to the SDK. For example, check if Web Account Manager (WAM) support has been enabled. - {{ Fill in the Description }} + Gets global configurations that apply to the SDK. For example, check if Web Account Manager (WAM) support has been enabled. Get-MgGraphOption + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + - + + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + + @@ -1271,10 +1505,13 @@ USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + ------- Example 1: Check if WAM support has been enabled ------- + PS C:\> Get-MgGraphOption +EnableWAMForMSGraph +-------------------- + True - {{ Add example description here }} + Confirms if WAM support has been enabled. @@ -1291,15 +1528,27 @@ USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us Get MgRequestContext - {{ Fill in the Synopsis }} + Gets graph request context details - {{ Fill in the Description }} + Gets graph request context details Get-MgRequestContext + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Confirm @@ -1325,6 +1574,18 @@ USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Confirm @@ -1377,10 +1638,13 @@ USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + ---------------- Example 1: Get request context ---------------- + PS C:\> Get-MgRequestContext +ClientTimeout RetryDelay MaxRetry RetriesTimeLimit +------------- ---------- -------- ---------------- +00:00:05 3 2 00:00:02 - {{ Add example description here }} + Gets graph request context details @@ -1619,6 +1883,18 @@ USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + @@ -1742,6 +2018,18 @@ USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us False + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + ResponseHeadersVariable @@ -1888,11 +2176,11 @@ surname Administrator Remove MgEnvironment - {{ Fill in the Synopsis }} + Removes Microsoft Graph environment to the settings file - {{ Fill in the Description }} + Removes Microsoft Graph environment to the settings file @@ -1909,6 +2197,18 @@ surname Administrator None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Confirm @@ -1946,6 +2246,18 @@ surname Administrator None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Confirm @@ -1998,10 +2310,13 @@ surname Administrator - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + ---------- Example 1: Remove user-defined environment ---------- + PS C:\> Remove-MgEnvironment Canary +Name AzureADEndpoint GraphEndpoint Type +---- --------------- ------------- ---- +Canary https://login.microsoftonline.com https://microsoftgraph.com User-defined - {{ Add example description here }} + Removes user-defined environment. @@ -2018,11 +2333,11 @@ surname Administrator Set MgEnvironment - {{ Fill in the Synopsis }} + Sets a Microsoft Graph environment to the settings file. - {{ Fill in the Description }} + Sets a Microsoft Graph environment to the settings file. @@ -2063,6 +2378,18 @@ surname Administrator None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Confirm @@ -2124,6 +2451,18 @@ surname Administrator None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + Confirm @@ -2176,10 +2515,10 @@ surname Administrator - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + ------ Example 1: Set environment for the current session ------ + PS C:\> Set-MgEnvironment -GraphEndpoint "https://canary.graph.microsoft.com" -AzureADEndpoint "https://login.microsoftonline.com" - {{ Add example description here }} + Sets the environment for the current session. @@ -2196,11 +2535,11 @@ surname Administrator Set MgGraphOption - {{ Fill in the Synopsis }} + Sets global configurations that apply to the SDK. For example, toggle Web Account Manager (WAM) support. - {{ Fill in the Description }} + Sets global configurations that apply to the SDK. For example, toggle Web Account Manager (WAM) support. @@ -2217,6 +2556,18 @@ surname Administrator None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + @@ -2232,6 +2583,18 @@ surname Administrator None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + @@ -2260,10 +2623,10 @@ surname Administrator - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + ---------- Example 1: Set web account manager support ---------- + PS C:\> Set-MgGraphOption -EnableLoginByWAM $True - {{ Add example description here }} + Sets web account manager support @@ -2280,11 +2643,11 @@ surname Administrator Set MgRequestContext - {{ Fill in the Synopsis }} + Sets request context for Microsoft Graph invocations - {{ Fill in the Description }} + Sets request context for Microsoft Graph invocations @@ -2313,6 +2676,18 @@ surname Administrator None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + RetriesTimeLimit @@ -2386,6 +2761,18 @@ surname Administrator None + + ProgressAction + + {{ Fill ProgressAction Description }} + + ActionPreference + + ActionPreference + + + None + RetriesTimeLimit @@ -2462,10 +2849,43 @@ surname Administrator - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + -------- Example 1: Set Http client timeout in seconds -------- + PS C:\> Set-MgRequestContext -ClientTimeout 5 +ClientTimeout RetryDelay MaxRetry RetriesTimeLimit +------------- ---------- -------- ---------------- +00:00:05 3 2 00:00:00 + + Sets Http client timeout in seconds. + + + + Example 2: Set the maximum time in seconds allowed for request retries + PS C:\> Set-MgRequestContext -RetriesTimeLimit 2 +ClientTimeout RetryDelay MaxRetry RetriesTimeLimit +------------- ---------- -------- ---------------- +00:00:05 3 2 00:00:02 + + Sets the maximum time in seconds allowed for request retries. + + + + -- Example 3: Set the maximum number of retries for a request -- + PS C:\> Set-MgRequestContext -MaxRetry 2 +ClientTimeout RetryDelay MaxRetry RetriesTimeLimit +------------- ---------- -------- ---------------- +00:00:05 3 2 00:00:02 + + Sets the maximum number of retries for a request. + + + + Example 4: Set the waiting time in seconds before retrying a request + PS C:\> Set-MgRequestContext -RetryDelay 3 +ClientTimeout RetryDelay MaxRetry RetriesTimeLimit +------------- ---------- -------- ---------------- +00:00:05 3 2 00:00:02 - {{ Add example description here }} + Sets the waiting time in seconds before retrying a request. diff --git a/src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec b/src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec index 6c2e698b026..fb8251032af 100644 --- a/src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec +++ b/src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec @@ -1,7 +1,7 @@ - 2.6.1 + 2.30.0 Microsoft.Graph.Authentication Microsoft Graph PowerShell authentication module Microsoft diff --git a/src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1 b/src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1 index 322b679fc0a..6bf28df09bc 100644 --- a/src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1 +++ b/src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft # -# Generated on: 21/09/2023 +# Generated on: 2025-09-24 # @{ @@ -12,7 +12,7 @@ RootModule = './Microsoft.Graph.Authentication.psm1' # Version number of this module. -ModuleVersion = '2.6.1' +ModuleVersion = '2.30.0' # Supported PSEditions CompatiblePSEditions = 'Core', 'Desktop' diff --git a/src/Authentication/Authentication/Models/AuthContext.cs b/src/Authentication/Authentication/Models/AuthContext.cs index 6538667da03..2b3b0567ed6 100644 --- a/src/Authentication/Authentication/Models/AuthContext.cs +++ b/src/Authentication/Authentication/Models/AuthContext.cs @@ -21,6 +21,7 @@ public class AuthContext : IAuthContext public string CertificateSubjectName { get; set; } public bool SendCertificateChain { get; set; } public string Account { get; set; } + public string UserPrincipalName { get; set; } public string AppName { get; set; } public ContextScope ContextScope { get; set; } public X509Certificate2 Certificate { get; set; } diff --git a/src/Authentication/docs/Add-MgEnvironment.md b/src/Authentication/docs/Add-MgEnvironment.md index b2cec826955..7462ec561a1 100644 --- a/src/Authentication/docs/Add-MgEnvironment.md +++ b/src/Authentication/docs/Add-MgEnvironment.md @@ -13,8 +13,8 @@ schema: 2.0.0 ## SYNTAX ``` -Add-MgEnvironment [-Name] [-AzureADEndpoint] [-GraphEndpoint] [-WhatIf] [-Confirm] - [] +Add-MgEnvironment [-Name] [-AzureADEndpoint] [-GraphEndpoint] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -79,6 +79,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -116,11 +131,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### System.String - ## OUTPUTS ### Microsoft.Graph.PowerShell.Authentication.Models.GraphEnvironment - ## NOTES ## RELATED LINKS diff --git a/src/Authentication/docs/Connect-MgGraph.md b/src/Authentication/docs/Connect-MgGraph.md index 9ef5d0af7ce..cb97a6b2b93 100644 --- a/src/Authentication/docs/Connect-MgGraph.md +++ b/src/Authentication/docs/Connect-MgGraph.md @@ -15,39 +15,41 @@ Microsoft Graph PowerShell supports two types of authentication: delegated and a ### UserParameterSet (Default) ``` Connect-MgGraph [[-Scopes] ] [[-ClientId] ] [-TenantId ] - [-ContextScope ] [-Environment ] [-UseDeviceCode] [-ClientTimeout ] [-NoWelcome] - [] + [-ContextScope ] [-Environment ] [-UseDeviceCode] [-ClientTimeout ] + [-UserPrincipalName ] [-NoWelcome] [-ProgressAction ] [] ``` ### AppCertificateParameterSet ``` Connect-MgGraph [-ClientId] [[-CertificateSubjectName] ] [[-CertificateThumbprint] ] - [-Certificate ] [-TenantId ] [-ContextScope ] [-Environment ] - [-ClientTimeout ] [-NoWelcome] [] + [-SendCertificateChain ] [-Certificate ] [-TenantId ] + [-ContextScope ] [-Environment ] [-ClientTimeout ] [-NoWelcome] + [-ProgressAction ] [] ``` ### IdentityParameterSet ``` Connect-MgGraph [[-ClientId] ] [-ContextScope ] [-Environment ] - [-ClientTimeout ] [-Identity] [-NoWelcome] [] + [-ClientTimeout ] [-Identity] [-NoWelcome] [-ProgressAction ] [] ``` ### AppSecretCredentialParameterSet ``` Connect-MgGraph [-ClientSecretCredential ] [-TenantId ] [-ContextScope ] - [-Environment ] [-ClientTimeout ] [-NoWelcome] [] + [-Environment ] [-ClientTimeout ] [-NoWelcome] [-ProgressAction ] + [] ``` ### AccessTokenParameterSet ``` Connect-MgGraph [-AccessToken] [-Environment ] [-ClientTimeout ] [-NoWelcome] - [] + [-ProgressAction ] [] ``` ### EnvironmentVariableParameterSet ``` Connect-MgGraph [-ContextScope ] [-Environment ] [-ClientTimeout ] - [-EnvironmentVariable] [-NoWelcome] [] + [-EnvironmentVariable] [-NoWelcome] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -351,6 +353,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Scopes An array of delegated permissions to consent to. @@ -366,6 +383,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -SendCertificateChain +Include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication using given certificate. + +```yaml +Type: Boolean +Parameter Sets: AppCertificateParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -TenantId The id of the tenant to connect to. You can also use this parameter to specify your sign-in audience. @@ -399,6 +431,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -UserPrincipalName +Specifies the account that you want to use to connect in order to skip the connection prompt. + +```yaml +Type: String +Parameter Sets: UserParameterSet +Aliases: UPN + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/src/Authentication/docs/Disconnect-MgGraph.md b/src/Authentication/docs/Disconnect-MgGraph.md index 0414a17ed25..5090ff2a93f 100644 --- a/src/Authentication/docs/Disconnect-MgGraph.md +++ b/src/Authentication/docs/Disconnect-MgGraph.md @@ -13,7 +13,7 @@ Once you're signed in, you'll remain signed in until you invoke Disconnect-MgGra ## SYNTAX ``` -Disconnect-MgGraph [] +Disconnect-MgGraph [-ProgressAction ] [] ``` ## DESCRIPTION @@ -30,6 +30,21 @@ Use Disconnect-MgGraph to sign out. ## PARAMETERS +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/src/Authentication/docs/Get-MgContext.md b/src/Authentication/docs/Get-MgContext.md index 73205cb2963..204b27b0e8f 100644 --- a/src/Authentication/docs/Get-MgContext.md +++ b/src/Authentication/docs/Get-MgContext.md @@ -13,7 +13,7 @@ Get-MgContext is used to retrieve the details about your current session, which ## SYNTAX ``` -Get-MgContext [] +Get-MgContext [-ProgressAction ] [] ``` ## DESCRIPTION @@ -61,6 +61,21 @@ Retrieves all scopes. ## PARAMETERS +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/src/Authentication/docs/Get-MgEnvironment.md b/src/Authentication/docs/Get-MgEnvironment.md index bfbeeb85d49..fefd96d8fb0 100644 --- a/src/Authentication/docs/Get-MgEnvironment.md +++ b/src/Authentication/docs/Get-MgEnvironment.md @@ -13,7 +13,7 @@ When you use Connect-MgGraph, you can choose to target other environments. By de ## SYNTAX ``` -Get-MgEnvironment [[-Name] ] [] +Get-MgEnvironment [[-Name] ] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -51,6 +51,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/src/Authentication/docs/Get-MgGraphOption.md b/src/Authentication/docs/Get-MgGraphOption.md index f4ef0a7c258..6311636efbe 100644 --- a/src/Authentication/docs/Get-MgGraphOption.md +++ b/src/Authentication/docs/Get-MgGraphOption.md @@ -13,7 +13,7 @@ Gets global configurations that apply to the SDK. For example, check if Web Acco ## SYNTAX ``` -Get-MgGraphOption [] +Get-MgGraphOption [-ProgressAction ] [] ``` ## DESCRIPTION @@ -33,17 +33,30 @@ Confirms if WAM support has been enabled. ## PARAMETERS +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### None - ## OUTPUTS ### Microsoft.Graph.PowerShell.Authentication.IGraphOption - ## NOTES ## RELATED LINKS diff --git a/src/Authentication/docs/Get-MgRequestContext.md b/src/Authentication/docs/Get-MgRequestContext.md index 57dc6171167..a21668b9cfb 100644 --- a/src/Authentication/docs/Get-MgRequestContext.md +++ b/src/Authentication/docs/Get-MgRequestContext.md @@ -13,7 +13,7 @@ Gets graph request context details ## SYNTAX ``` -Get-MgRequestContext [-WhatIf] [-Confirm] [] +Get-MgRequestContext [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -33,6 +33,21 @@ Gets graph request context details ## PARAMETERS +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -70,11 +85,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### None - ## OUTPUTS ### Microsoft.Graph.PowerShell.Authentication.Core.Interfaces.IRequestContext - ## NOTES ## RELATED LINKS diff --git a/src/Authentication/docs/Invoke-MgGraphRequest.md b/src/Authentication/docs/Invoke-MgGraphRequest.md index 5db5c8f361a..6bd5cffa271 100644 --- a/src/Authentication/docs/Invoke-MgGraphRequest.md +++ b/src/Authentication/docs/Invoke-MgGraphRequest.md @@ -18,7 +18,7 @@ Invoke-MgGraphRequest [[-Method] ] [-Uri] [[-Body] ] [[-SessionVariable] ] [[-ResponseHeadersVariable] ] [[-StatusCodeVariable] ] [-SkipHttpErrorCheck] [[-GraphRequestSession] ] [[-UserAgent] ] [[-OutputType] ] - [] + [-ProgressAction ] [] ``` ## DESCRIPTION @@ -203,6 +203,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResponseHeadersVariable Response Headers Variable diff --git a/src/Authentication/docs/Microsoft.Graph.Authentication.md b/src/Authentication/docs/Microsoft.Graph.Authentication.md index 17e975f3484..978613c4d89 100644 --- a/src/Authentication/docs/Microsoft.Graph.Authentication.md +++ b/src/Authentication/docs/Microsoft.Graph.Authentication.md @@ -1,6 +1,6 @@ --- Module Name: Microsoft.Graph.Authentication -Module Guid: 0fecf360-9875-4e02-998c-b6d7b6653b6b +Module Guid: 889b7d72-99b2-4498-9683-2308236c70ba Download Help Link: https://learn.microsoft.com/powershell/module/Microsoft.Graph.Authentication Help Version: 1.0.0.0 Locale: en-US diff --git a/src/Authentication/docs/Remove-MgEnvironment.md b/src/Authentication/docs/Remove-MgEnvironment.md index 4fd5c7a0446..4cc076e75ec 100644 --- a/src/Authentication/docs/Remove-MgEnvironment.md +++ b/src/Authentication/docs/Remove-MgEnvironment.md @@ -13,7 +13,8 @@ Removes Microsoft Graph environment to the settings file ## SYNTAX ``` -Remove-MgEnvironment [-Name] [-WhatIf] [-Confirm] [] +Remove-MgEnvironment [-Name] [-ProgressAction ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -48,6 +49,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -85,11 +101,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### System.String - ## OUTPUTS ### Microsoft.Graph.PowerShell.Authentication.Models.GraphEnvironment - ## NOTES ## RELATED LINKS diff --git a/src/Authentication/docs/Set-MgEnvironment.md b/src/Authentication/docs/Set-MgEnvironment.md index 12e2632fce2..54412bd755b 100644 --- a/src/Authentication/docs/Set-MgEnvironment.md +++ b/src/Authentication/docs/Set-MgEnvironment.md @@ -13,8 +13,8 @@ Sets a Microsoft Graph environment to the settings file. ## SYNTAX ``` -Set-MgEnvironment [-Name] [[-AzureADEndpoint] ] [[-GraphEndpoint] ] [-WhatIf] - [-Confirm] [] +Set-MgEnvironment [-Name] [[-AzureADEndpoint] ] [[-GraphEndpoint] ] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -76,6 +76,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -113,11 +128,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### System.String - ## OUTPUTS ### Microsoft.Graph.PowerShell.Authentication.Models.GraphEnvironment - ## NOTES ## RELATED LINKS diff --git a/src/Authentication/docs/Set-MgGraphOption.md b/src/Authentication/docs/Set-MgGraphOption.md index 85ee3e9fca6..01f61d9ef74 100644 --- a/src/Authentication/docs/Set-MgGraphOption.md +++ b/src/Authentication/docs/Set-MgGraphOption.md @@ -13,7 +13,7 @@ Sets global configurations that apply to the SDK. For example, toggle Web Accoun ## SYNTAX ``` -Set-MgGraphOption [-EnableLoginByWAM ] [] +Set-MgGraphOption [-EnableLoginByWAM ] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -45,13 +45,27 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### None - ## OUTPUTS ### System.Object diff --git a/src/Authentication/docs/Set-MgRequestContext.md b/src/Authentication/docs/Set-MgRequestContext.md index afd36ba276b..5a6b43457fe 100644 --- a/src/Authentication/docs/Set-MgRequestContext.md +++ b/src/Authentication/docs/Set-MgRequestContext.md @@ -14,7 +14,7 @@ Sets request context for Microsoft Graph invocations ``` Set-MgRequestContext [-RetryDelay ] [-MaxRetry ] [-RetriesTimeLimit ] - [-ClientTimeout ] [-WhatIf] [-Confirm] [] + [-ClientTimeout ] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -95,6 +95,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -RetriesTimeLimit Sets the maximum time in seconds allowed for request retries. @@ -163,11 +178,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### System.Int32 - ## OUTPUTS ### Microsoft.Graph.PowerShell.Authentication.Core.Interfaces.IRequestContext - ## NOTES ## RELATED LINKS