< Back
New-MsalClientApplication
Post
NAME New-MsalClientApplication
SYNOPSIS
Create new client application.
SYNTAX
New-MsalClientApplication -ClientId <String> [-RedirectUri <Uri>] [-TenantId <String>] [-Authority <Uri>]
[<CommonParameters>]
New-MsalClientApplication [-ClientId <String>] [-ClientSecret <SecureString>] [-ClientCertificate
<X509Certificate2>] [-RedirectUri <Uri>] [-TenantId <String>] [-Authority <Uri>] [-ConfidentialClientOptions]
<ConfidentialClientApplicationOptions> [<CommonParameters>]
New-MsalClientApplication -ClientId <String> -ClientCertificate <X509Certificate2> [-RedirectUri <Uri>] [-TenantId
<String>] [-Authority <Uri>] [<CommonParameters>]
New-MsalClientApplication -ClientId <String> -ClientSecret <SecureString> [-RedirectUri <Uri>] [-TenantId
<String>] [-Authority <Uri>] [<CommonParameters>]
New-MsalClientApplication [-ClientId <String>] [-RedirectUri <Uri>] [-TenantId <String>] [-Authority <Uri>]
[-PublicClientOptions] <PublicClientApplicationOptions> [<CommonParameters>]
DESCRIPTION
This cmdlet will return a new client application object which can be used with the Get-MsalToken cmdlet.
PARAMETERS
-ClientId <String>
Identifier of the client requesting the token.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ClientSecret <SecureString>
Secure secret of the client requesting the token.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ClientCertificate <X509Certificate2>
Client assertion certificate of the client requesting the token.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-RedirectUri <Uri>
Address to return to upon receiving a response from the authority.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-TenantId <String>
Tenant identifier of the authority to issue token.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Authority <Uri>
Address of the authority to issue token.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-PublicClientOptions <PublicClientApplicationOptions>
Public client application options
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-ConfidentialClientOptions <ConfidentialClientApplicationOptions>
Confidential client application options
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Microsoft.Identity.Client.PublicClientApplication
Microsoft.Identity.Client.ConfidentialClientApplication
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-MsalClientApplication -ClientId '00000000-0000-0000-0000-000000000000'
Get public client application using default settings.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$ConfidentialClientOptions = New-Object Microsoft.Identity.Client.ConfidentialClientApplicationOptions
-Properties @{ ClientId = '00000000-0000-0000-0000-000000000000' }
PS C:\\>$ConfidentialClientOptions | Get-MsalClientApplication -ClientSecret (ConvertTo-SecureString
'SuperSecretString' -AsPlainText -Force) -TenantId '00000000-0000-0000-0000-000000000000'
Pipe in confidential client options object to get a confidential client application using a client secret and
target a specific tenant.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>$ClientCertificate = Get-Item Cert:\\CurrentUser\\My\\0000000000000000000000000000000000000000
PS C:\\>$ConfidentialClientOptions = New-Object Microsoft.Identity.Client.ConfidentialClientApplicationOptions
-Properties @{ ClientId = '00000000-0000-0000-0000-000000000000'; TenantId =
'00000000-0000-0000-0000-000000000000' }
PS C:\\>$ConfidentialClientOptions | Get-MsalClientApplication -ClientCertificate $ClientCertificate
Pipe in confidential client options object to get a confidential client application using a client certificate and
target a specific tenant.
RELATED LINKS
SYNOPSIS
Create new client application.
SYNTAX
New-MsalClientApplication -ClientId <String> [-RedirectUri <Uri>] [-TenantId <String>] [-Authority <Uri>]
[<CommonParameters>]
New-MsalClientApplication [-ClientId <String>] [-ClientSecret <SecureString>] [-ClientCertificate
<X509Certificate2>] [-RedirectUri <Uri>] [-TenantId <String>] [-Authority <Uri>] [-ConfidentialClientOptions]
<ConfidentialClientApplicationOptions> [<CommonParameters>]
New-MsalClientApplication -ClientId <String> -ClientCertificate <X509Certificate2> [-RedirectUri <Uri>] [-TenantId
<String>] [-Authority <Uri>] [<CommonParameters>]
New-MsalClientApplication -ClientId <String> -ClientSecret <SecureString> [-RedirectUri <Uri>] [-TenantId
<String>] [-Authority <Uri>] [<CommonParameters>]
New-MsalClientApplication [-ClientId <String>] [-RedirectUri <Uri>] [-TenantId <String>] [-Authority <Uri>]
[-PublicClientOptions] <PublicClientApplicationOptions> [<CommonParameters>]
DESCRIPTION
This cmdlet will return a new client application object which can be used with the Get-MsalToken cmdlet.
PARAMETERS
-ClientId <String>
Identifier of the client requesting the token.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ClientSecret <SecureString>
Secure secret of the client requesting the token.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ClientCertificate <X509Certificate2>
Client assertion certificate of the client requesting the token.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-RedirectUri <Uri>
Address to return to upon receiving a response from the authority.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-TenantId <String>
Tenant identifier of the authority to issue token.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Authority <Uri>
Address of the authority to issue token.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-PublicClientOptions <PublicClientApplicationOptions>
Public client application options
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-ConfidentialClientOptions <ConfidentialClientApplicationOptions>
Confidential client application options
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Microsoft.Identity.Client.PublicClientApplication
Microsoft.Identity.Client.ConfidentialClientApplication
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-MsalClientApplication -ClientId '00000000-0000-0000-0000-000000000000'
Get public client application using default settings.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$ConfidentialClientOptions = New-Object Microsoft.Identity.Client.ConfidentialClientApplicationOptions
-Properties @{ ClientId = '00000000-0000-0000-0000-000000000000' }
PS C:\\>$ConfidentialClientOptions | Get-MsalClientApplication -ClientSecret (ConvertTo-SecureString
'SuperSecretString' -AsPlainText -Force) -TenantId '00000000-0000-0000-0000-000000000000'
Pipe in confidential client options object to get a confidential client application using a client secret and
target a specific tenant.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>$ClientCertificate = Get-Item Cert:\\CurrentUser\\My\\0000000000000000000000000000000000000000
PS C:\\>$ConfidentialClientOptions = New-Object Microsoft.Identity.Client.ConfidentialClientApplicationOptions
-Properties @{ ClientId = '00000000-0000-0000-0000-000000000000'; TenantId =
'00000000-0000-0000-0000-000000000000' }
PS C:\\>$ConfidentialClientOptions | Get-MsalClientApplication -ClientCertificate $ClientCertificate
Pipe in confidential client options object to get a confidential client application using a client certificate and
target a specific tenant.
RELATED LINKS