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
System.Object
SynchronizingUserService
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Security
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
[Obsolete("Use ISynchronizingUserService instead")]
public class SynchronizingUserService : ISynchronizingUserService

Constructors

SynchronizingUserService()

Declaration
public SynchronizingUserService()

Methods

ClearRoles(String)

Clears all previously synched roles for a user.

Declaration
public virtual void ClearRoles(string userName)
Parameters
Type Name Description
System.String userName

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>

A list of matching roles.

FindUsers(String)

Finds all users that has a matching name or email. 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 or email 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

Synchronize(ClaimsIdentity, IEnumerable<String>)

Synchronizes a claims identity to the database

Declaration
public virtual void Synchronize(ClaimsIdentity identity, IEnumerable<string> additionalClaimsToSync)
Parameters
Type Name Description
System.Security.Claims.ClaimsIdentity identity

The claims identity

System.Collections.Generic.IEnumerable<System.String> additionalClaimsToSync
Remarks

By default is claims such as role claims and Email synched. additionalClaimsToSync can be specified to synchronize additional claims. This can be used for example to sync a phone number which then can be used by notification system.

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

SynchronizeAsync(ClaimsIdentity, IEnumerable<String>)

Synchronizes a claims identity to the database

Declaration
public virtual Task SynchronizeAsync(ClaimsIdentity identity, IEnumerable<string> additionalClaimsToSync)
Parameters
Type Name Description
System.Security.Claims.ClaimsIdentity identity

The claims identity

System.Collections.Generic.IEnumerable<System.String> additionalClaimsToSync
Returns
Type Description
System.Threading.Tasks.Task
Remarks

By default is claims such as role claims and Email synched. additionalClaimsToSync can be specified to synchronize additional claims. This can be used for example to sync a phone number which then can be used by notification system.

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

Implements

Extension Methods