Show / Hide Table of Contents

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 Source

ClaimsPrincipalToRosterPrincipalAsync(ClaimsPrincipal)

Creates an from a .

Declaration
Task<IRosterPrincipal> ClaimsPrincipalToRosterPrincipalAsync(ClaimsPrincipal principal)
Parameters
Type Name Description
ClaimsPrincipal principal

The principal to convert.

Returns
Type Description
Task<IRosterPrincipal>

See .

View Source

ClaimsPrincipalToRosterUserAsync(ClaimsPrincipal)

Creates an from a .

Declaration
Task<IRosterUser> ClaimsPrincipalToRosterUserAsync(ClaimsPrincipal principal)
Parameters
Type Name Description
ClaimsPrincipal principal

The principal to convert.

Returns
Type Description
Task<IRosterUser>

See .

View Source

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.

View Source

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.

View Source

GetCurrentUserAsync()

Gets the current user as an .

Declaration
Task<IRosterUser> GetCurrentUserAsync()
Returns
Type Description
Task<IRosterUser>

A object.

View Source

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 object.

View Source

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 object.

View Source

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.

  • View Source
In This Article
Back to top Generated by DocFX