I am in the process of transitioning from the Azure module to Az module commands to create an App registration and enable Implicit Grant. However, I have encountered a few parameters that are not available in the Az module.
Azure Module Script:
Connect-AzureAD -TenantId <<TenantId>>
$appName = "<<AppName>>"
$redirectUris = @("https://mspmecloud.onmicrosoft.com/$appName")
$secretName = "secretKey"
$App = (New-AzureADApplication -DisplayName $appName `
-ReplyUrls $redirectUris `
-Homepage "https://mspmecloud.onmicrosoft.com/$appName" `
-IdentifierUris "https://mspmecloud.onmicrosoft.com/$appName"`
-Oauth2AllowImplicitFlow $true -PublicClient $false
)
New-AzureADServicePrincipal -AccountEnabled $true -AppId $App.AppId -DisplayName $appName
Below is Az module Script:
$appName = "<<AppName>>"
$redirectUris = @("https://mspmecloud.onmicrosoft.com/$appName")
$secretName = "secretKey"
$App = (New-AzADApplication -DisplayName $appName `
-ReplyUrls $redirectUris `
-Homepage "https://mspmecloud.onmicrosoft.com/$appName" `
-IdentifierUris "https://mspmecloud.onmicrosoft.com/$appName"`
)
New-AzADServicePrincipal -ApplicationId $App.AppId
The documentation I am referring to for Az module commands is as follows: https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azadapplication?view=azps-11.1.0 https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azadserviceprincipal?view=azps-0.10.0
Is there an alternative method in the Az module PowerShell to enable "oauth2AllowImplicitFlow"?
I need to choose the options highlighted below using an Az module script.
To activate Implicit Grant & Hybrid Flows using the Az
module commands, you can make use of below updated script:
$appName = "<<AppName>>"
$redirectUris = @("https://mspmecloud.onmicrosoft.com/$appName")
$secretName = "secretKey"
$App = (New-AzADApplication -DisplayName $appName `
-ReplyUrls $redirectUris `
-Homepage "https://mspmecloud.onmicrosoft.com/$appName" `
-IdentifierUris "https://mspmecloud.onmicrosoft.com/$appName"`
-Web @{
ImplicitGrantSetting = @{
EnableAccessTokenIssuance = $true
EnableIdTokenIssuance = $true
}
}
)
New-AzADServicePrincipal -ApplicationId $App.AppId
Response:
When I checked the same in Portal, application created successfully with Implicit Grant & Hybrid Flows enabled like this: