Interface IUserAndGroupService
Functionality for working with AAD users and groups.
Namespace: Microsoft.GNS.Roster.Service
Assembly: Microsoft.GNS.Roster.Service.dll
Syntax
public interface IUserAndGroupService
Methods
View SourceClaimsPrincipalToRosterPrincipalAsync(ClaimsPrincipal)
Creates an
Declaration
Task<IRosterPrincipal> ClaimsPrincipalToRosterPrincipalAsync(ClaimsPrincipal principal)
Parameters
Type | Name | Description |
---|---|---|
ClaimsPrincipal | principal | The principal to convert. |
Returns
Type | Description |
---|---|
Task<IRosterPrincipal> | See |
ClaimsPrincipalToRosterUserAsync(ClaimsPrincipal)
Creates an
Declaration
Task<IRosterUser> ClaimsPrincipalToRosterUserAsync(ClaimsPrincipal principal)
Parameters
Type | Name | Description |
---|---|---|
ClaimsPrincipal | principal | The principal to convert. |
Returns
Type | Description |
---|---|
Task<IRosterUser> | See |
FindGroupsAsync(String, Int32)
Searches the group graph on displayName and mail.
Declaration
IAsyncEnumerable<IRosterSecurityGroup> FindGroupsAsync(string principalName, int maxSearchResults)
Parameters
Type | Name | Description |
---|---|---|
System.String | principalName | Term to do a startsWith search against Email or Display Name. |
System.Int32 | maxSearchResults | Maximum number of results to return. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterSecurityGroup> | Returns a filtered list of RosterSecurityGroup types generated from the graph. |
FindUsersAsync(String, Int32)
Searches the user graph on displayName and mail.
Declaration
IAsyncEnumerable<IRosterUser> FindUsersAsync(string principalName, int maxSearchResults)
Parameters
Type | Name | Description |
---|---|---|
System.String | principalName | Term to do a startsWith search against Email or Display Name. |
System.Int32 | maxSearchResults | Maximum number of results to return. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterUser> | Returns a filtered list of RosterUser types generated from the graph. |
GetCurrentUserAsync()
Gets the current user as an
Declaration
Task<IRosterUser> GetCurrentUserAsync()
Returns
Type | Description |
---|---|
Task<IRosterUser> | A |
GetSecurityGroupAsync(String)
Gets a security group.
Declaration
Task<IRosterSecurityGroup> GetSecurityGroupAsync(string groupIdentifier)
Parameters
Type | Name | Description |
---|---|---|
System.String | groupIdentifier | The AAD group Id or group name or group email. |
Returns
Type | Description |
---|---|
Task<IRosterSecurityGroup> | A |
GetUserAsync(String)
Gets a user profile.
Declaration
Task<IRosterUser> GetUserAsync(string principalName)
Parameters
Type | Name | Description |
---|---|---|
System.String | principalName | The email formatted principal name. i.e. alias@microsoft.com. |
Returns
Type | Description |
---|---|
Task<IRosterUser> | A |
IsCurrentUserMemberOfSecurityGroupAsync(Guid)
Determines if the current user is a member of a security group.
Declaration
Task<bool> IsCurrentUserMemberOfSecurityGroupAsync(Guid groupId)
Parameters
Type | Name | Description |
---|---|---|
Guid | groupId | The security group Id in which to check membership. |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True if the current user is a member. Otherwise, false. |