Interface IUserAndGroupStore
Functionality for working with AAD users and groups.
Namespace: Microsoft.GNS.Roster.DataAccess
Assembly: Microsoft.GNS.Roster.DataAccess.dll
Syntax
public interface IUserAndGroupStore
Methods
View SourceFindGroupsAsync(String, Int32)
Searches the group graph on displayName and mail.
Declaration
IAsyncEnumerable<Group> 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<Group> | Returns a filtered list of RosterSecurityGroup types generated from the graph. |
FindUsersAsync(String, Int32)
Searches the user graph on displayName and mail.
Declaration
IAsyncEnumerable<User> 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<User> | Returns a filtered list of RosterUser types generated from the graph. |
GetCurrentUserAsync()
Gets the currently logged in user.
Declaration
Task<User?> GetCurrentUserAsync()
Returns
Type | Description |
---|---|
Task<System.Nullable<User>> | A |
GetSecurityGroupAsync(String)
Gets a security group.
Declaration
Task<Group?> GetSecurityGroupAsync(string groupIdentifier)
Parameters
Type | Name | Description |
---|---|---|
System.String | groupIdentifier | The AAD group Id or group name or group email. |
Returns
Type | Description |
---|---|
Task<System.Nullable<Group>> | A |
GetUserAsync(String)
Gets a user profile.
Declaration
Task<User?> GetUserAsync(string principalName)
Parameters
Type | Name | Description |
---|---|---|
System.String | principalName | The email formatted principal name. i.e. alias@microsoft.com. |
Returns
Type | Description |
---|---|
Task<System.Nullable<User>> | A |
IsMemberOfOffice365GroupAsync(String, String)
Check if a user is a member of an Office 365 group in AAD.
Declaration
Task<bool> IsMemberOfOffice365GroupAsync(string principalName, string groupName)
Parameters
Type | Name | Description |
---|---|---|
System.String | principalName | The email formatted principal name. i.e. alias@microsoft.com. |
System.String | groupName | An Office 365 group name. |
Returns
Type | Description |
---|---|
Task<System.Boolean> |
IsMemberOfSecurityGroupAsync(Guid)
Checks if a user is a member of a security group.
Declaration
Task<bool> IsMemberOfSecurityGroupAsync(Guid groupId)
Parameters
Type | Name | Description |
---|---|---|
Guid | groupId | The principal Id of the group in which to check membership. |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True if the user is the member of a group. Otherwise, false. |
IsMemberOfSecurityGroupAsync(String, String)
Checks if a user is a member of a security group.
Declaration
Task<bool> IsMemberOfSecurityGroupAsync(string principalName, string groupName)
Parameters
Type | Name | Description |
---|---|---|
System.String | principalName | The email formatted principal name. i.e. alias@microsoft.com. |
System.String | groupName | An AAD group name. |
Returns
Type | Description |
---|---|
Task<System.Boolean> | True if the user is the member of a group. Otherwise, false. |