-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroupAuthorizationRequirement.cs
More file actions
32 lines (29 loc) · 1.28 KB
/
GroupAuthorizationRequirement.cs
File metadata and controls
32 lines (29 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// <copyright file="GroupAuthorizationRequirement.cs" company="Moonrise Software, LLC">
// Copyright (c) Moonrise Software, LLC. All rights reserved.
// Licensed under the GNU Public License, Version 3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
// See https://github.com/MoonriseSoftwareCalifornia/CosmosCMS
// for more information concerning the license and the contributors participating to this project.
// </copyright>
namespace Cosmos.MicrosoftGraph
{
using Microsoft.AspNetCore.Authorization;
/// <summary>
/// Group authorization requirement based on the Entra ID Group ID.
/// </summary>
// SEE: https://damienbod.com/2021/09/06/using-azure-security-groups-in-asp-net-core-with-an-azure-b2c-identity-provider/
public class GroupAuthorizationRequirement : IAuthorizationRequirement
{
/// <summary>
/// Initializes a new instance of the <see cref="GroupAuthorizationRequirement"/> class.
/// </summary>
/// <param name="groupName">Group display name.</param>
public GroupAuthorizationRequirement(string groupName)
{
this.GroupDisplayName = groupName;
}
/// <summary>
/// Gets the Entra ID Group display name.
/// </summary>
public string GroupDisplayName { get; }
}
}