Class SynchronizingUserService
NOTE: This is a pre-release API that is UNSTABLE and might not satisfy the compatibility requirements as denoted by its associated normal version. Service that can be used to synchronize users and roles for later retrieval.
Inheritance
Inherited Members
Namespace: EPiServer.Security
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public class SynchronizingUserService
Constructors
SynchronizingUserService()
Initializes a new instance of the SynchronizingUserService class.
Declaration
public SynchronizingUserService()
Methods
FindRoles(String)
Finds all roles that has a matching name. if null is passed in all roles are returned.
Declaration
public virtual IEnumerable<string> FindRoles(string partOfName)
Parameters
Type | Name | Description |
---|---|---|
System.String | partOfName | The name to match, '%' is wildcard symbol. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
|
FindUsers(String)
Finds all users that has a matching name. if null is passed in all users are returned.
Declaration
public virtual IEnumerable<string> FindUsers(string partOfName)
Parameters
Type | Name | Description |
---|---|---|
System.String | partOfName | The name to match, '%' is wildcard symbol. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | A list of matching user names. |
GetRolesForUser(String)
Retrieves all synched roles for given user.
Declaration
public virtual IEnumerable<string> GetRolesForUser(string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | The name of the synched user. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | A list of all synched roles for the user. |
HideRole(String)
A synched role can be hidden, meaning it will not be returned from FindRoles.
Declaration
public virtual void HideRole(string role)
Parameters
Type | Name | Description |
---|---|---|
System.String | role | The role to hide |
ListRoleStatus()
List all synched roles together with their current status.
Declaration
public virtual IEnumerable<SynchronizedRoleStatus> ListRoleStatus()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SynchronizedRoleStatus> | A list of synched role and their status. |
ShowRole(String)
Call to show a previously hidden role in FindRoles.
Declaration
public virtual void ShowRole(string role)
Parameters
Type | Name | Description |
---|---|---|
System.String | role | The role that should shown. |
Synchronize(ClaimsIdentity)
Synchronizes a claims identity to the database
Declaration
public virtual void Synchronize(ClaimsIdentity identity)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Claims.ClaimsIdentity | identity | The claims identity |
SynchronizeAsync(ClaimsIdentity)
Synchronizes a claims identity to the database
Declaration
public virtual Task SynchronizeAsync(ClaimsIdentity identity)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Claims.ClaimsIdentity | identity | The claims identity |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
SynchronizeUserAndRoles(String, IEnumerable<String>)
Synchronizes a user and his/her roles.
Declaration
public virtual void SynchronizeUserAndRoles(string userName, IEnumerable<string> roles)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | The username |
System.Collections.Generic.IEnumerable<System.String> | roles | The roles for the user |