Skip to content

Commit f060f80

Browse files
author
Kalyan Krishna
authored
Merge pull request #110 from Azure-Samples/kkrishna/rolesfix
bug fix
2 parents 958bafe + c955681 commit f060f80

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

5-WebApp-AuthZ/5-1-Roles/AppCreationScripts/Cleanup.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ This function removes the Azure AD applications for the sample. These applicatio
5555
if ($app)
5656
{
5757
Remove-AzureADApplication -ObjectId $app.ObjectId
58-
Write-Host "Removed."
58+
Write-Host "Removed WebApp-RolesClaims."
59+
}
5960
}
60-
61-
}
6261

6362
Cleanup -Credential $Credential -tenantId $TenantId

5-WebApp-AuthZ/5-1-Roles/AppCreationScripts/Configure.ps1

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ Function ConfigureApplications
145145
so that they are consistent with the Applications parameters
146146
#>
147147

148+
$commonendpoint = "common"
149+
148150
# $tenantId is the Active Directory Tenant. This is a GUID which represents the "Directory ID" of the AzureAD tenant
149151
# into which you want to create the apps. Look it up in the Azure portal in the "Properties" of the Azure AD.
150152

@@ -191,7 +193,6 @@ Function ConfigureApplications
191193
-IdentifierUris "https://$tenantName/WebApp-RolesClaims" `
192194
-PasswordCredentials $key `
193195
-Oauth2AllowImplicitFlow $true `
194-
-GroupMembershipClaims "SecurityGroup" `
195196
-PublicClient $False
196197

197198
$currentAppId = $webAppAadApplication.AppId
@@ -203,7 +204,7 @@ Function ConfigureApplications
203204
{
204205
Add-AzureADApplicationOwner -ObjectId $webAppAadApplication.ObjectId -RefObjectId $user.ObjectId
205206
Write-Host "'$($user.UserPrincipalName)' added as an application owner to app '$($webAppServicePrincipal.DisplayName)'"
206-
207+
207208
# assign the current user to the app as well
208209
New-AzureADUserAppRoleAssignment -ObjectId $user.ObjectId -PrincipalId $user.ObjectId -ResourceId $webAppServicePrincipal.ObjectId -Id ([Guid]::Empty)
209210
}
@@ -234,8 +235,14 @@ Function ConfigureApplications
234235
$dictionary = @{ "ClientId" = $webAppAadApplication.AppId;"TenantId" = $tenantId;"Domain" = $tenantName;"ClientSecret" = $webAppAppKey };
235236
UpdateTextFile -configFilePath $configFile -dictionary $dictionary
236237
Write-Host ""
237-
Write-Host -ForegroundColor Green "Run the ..\CreateUsersAndRoles.ps1 command to automatically create a number of users, app roles and assign users to these roles or refer to the 'Define your application roles' section in README on how to configure your newly created app further for this sample."
238-
238+
Write-Host -ForegroundColor Green "------------------------------------------------------------------------------------------------"
239+
Write-Host "IMPORTANT: Please follow the instructions below to complete a few manual step(s) in the Azure portal":
240+
Write-Host "- For 'webApp'"
241+
Write-Host " - Navigate to '$webAppPortalUrl'"
242+
Write-Host " - Run the ..\CreateUsersAndRoles.ps1 command to automatically create a number of users, app roles and assign users to these roles or refer to the 'Define your application roles' section in README on how to configure your newly created app further for this sample." -ForegroundColor Red
243+
244+
Write-Host -ForegroundColor Green "------------------------------------------------------------------------------------------------"
245+
239246
Add-Content -Value "</tbody></table></body></html>" -Path createdApps.html
240247
}
241248

5-WebApp-AuthZ/5-1-Roles/README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,6 @@ Navigate to the `"5-WebApp-AuthZ"` folder
8585

8686
### Step 2: Configure your application to receive the **roles** claims
8787

88-
1. In your application settings page on the Application Registration Portal (preview), click on "Manifest" to open the inline manifest editor.
89-
2. Edit the manifest by locating the "groupMembershipClaims" setting, and setting its value to "SecurityGroup".
90-
3. Save the manifest.
91-
92-
```JSON
93-
{
94-
...
95-
"errorUrl": null,
96-
"groupMembershipClaims": "SecurityGroup",
97-
...
98-
}
99-
```
100-
10188
1. To receive the `roles` claim with the name of the app roles this user is assigned to, make sure that the user accounts you plan to sign-in to this app is assigned to the app roles of this app.
10289

10390
#### Step 3: Define your Application Roles

0 commit comments

Comments
 (0)