PowerShell command to enable the "MSAL Only" Redirect URI

Pablo Glomby 186 Reputation points
2021-07-23T18:18:52.123+00:00

I am creating a PowerShell script to register an application.
The app is created using
New-AzureADMSApplication -DisplayName $appName -SignInAudience AzureADMultipleOrgs -PublicClient @{ RedirectUris = $replyURI }
I need to have both the RedirectUri and the "MSAL Only" URI.

How can I achieve this?

I prefer not to use the Graph API if possible.

Thanks

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,555 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,141 questions
0 comments No comments
{count} votes

Accepted answer
  1. Siva-kumar-selvaraj 15,651 Reputation points
    2021-07-26T20:00:48.847+00:00

    Hello @Pablo Glomby ,

    Thanks for reaching out and sorry for delayed response.

    The "MSAL Only" Redirect URI must be in the form of msal.[app_id]://auth [ Ex: msal2e847051-973b-4343-8566-01ab9fce590c://auth ] hence we need to create application in first place and then update the RedirectUri and the "MSAL Only" URI as shown below:

    • Create new Azure AD Application and pass them into variable: $app = New-AzureADMSApplication -DisplayName TestApp -SignInAudience AzureADMultipleOrgs
    • Append following characters msal & ://auth along with AppID and then pass the outcome into variable: $msalonly = 'msal'+$app.AppId+'://auth'
    • Set PublicClient RedirectUris as shown below: Set-AzureADMSApplication -ObjectId $app.Id -PublicClient @{RedirectUris = "https://mynewapp.contoso.com/", $msalonly }

    Final outcome:

    117970-image.png

    Hope this helps.

    ------
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.