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 for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Answer accepted by question author
  1. Siva-kumar-selvaraj 15,731 Reputation points Volunteer Moderator
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.