Try our conversational search powered by Generative AI!

Class MembershipSecurityEntityProvider

Implemantation of SecurityEntityProvider that delegates calls to configured System.Web.Security.Membership and System.Web.Security.Roles providers.

Inheritance
System.Object
MembershipSecurityEntityProvider
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.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class MembershipSecurityEntityProvider : SecurityEntityProvider

Constructors

MembershipSecurityEntityProvider()

Default constuctor, will use System.Web.Security.Membership.Provider and System.Web.Security.Roles.Provider.

Declaration
public MembershipSecurityEntityProvider()

MembershipSecurityEntityProvider(MembershipProvider, RoleProvider)

Constructor with dependencies.

Declaration
[Obsolete("Use alternative constructor")]
public MembershipSecurityEntityProvider(MembershipProvider membershipProvder, RoleProvider roleProvider)
Parameters
Type Name Description
System.Web.Security.MembershipProvider membershipProvder

The membership provider to use.

System.Web.Security.RoleProvider roleProvider

The membership provider to use.

MembershipSecurityEntityProvider(MembershipProvider, RoleProvider, Boolean)

Constructor with dependencies.

Declaration
[Obsolete("Use alternative constructor")]
public MembershipSecurityEntityProvider(MembershipProvider membershipProvder, RoleProvider roleProvider, bool rolesEnabled)
Parameters
Type Name Description
System.Web.Security.MembershipProvider membershipProvder

The membership provider to use.

System.Web.Security.RoleProvider roleProvider

The membership provider to use.

System.Boolean rolesEnabled

Specifies if Roles feature is enabled/>

MembershipSecurityEntityProvider(MembershipProvider, RoleProvider, Boolean, ClaimTypeOptions)

Constructor with dependencies.

Declaration
public MembershipSecurityEntityProvider(MembershipProvider membershipProvder, RoleProvider roleProvider, bool rolesEnabled, ClaimTypeOptions claimTypeOptions)
Parameters
Type Name Description
System.Web.Security.MembershipProvider membershipProvder

The membership provider to use.

System.Web.Security.RoleProvider roleProvider

The membership provider to use.

System.Boolean rolesEnabled

Specifies if Roles feature is enabled/>

ClaimTypeOptions claimTypeOptions

The claim type options to use.

Methods

FindUsersInRole(String, String, Int32, Int32, out Int32)

Returns users that are part of given role.

Declaration
public override IEnumerable<string> FindUsersInRole(string roleName, string usernameToMatch, int startIndex, int maxRows, out int totalCount)
Parameters
Type Name Description
System.String roleName

The name of the role to get users for

System.String usernameToMatch

The username to match for. Pass in null to match all users.

System.Int32 startIndex

The start index, used for paging

System.Int32 maxRows

The maximum number of rows returned

System.Int32 totalCount

The total amount of matched entites.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

A list of matched users

Overrides
Remarks

The recommendation is to support partly matches on usernameToMatch. For example in an implementation that uses SQL server the recommendation is to surround the specified value with '%' and use the 'LIKE' operator.

Default implementation returns empty list. Should be overridden to support functionality.

Implemenations should return empty list when role does not exist

GetRolesForUser(String)

Retrieves all roles for user with given userName.

Declaration
public override IEnumerable<string> GetRolesForUser(string userName)
Parameters
Type Name Description
System.String userName

The name of the user.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

A list of all roles for the user.

Overrides

Search(String, String)

Searches all security entities of given type with a matching name.

Declaration
public override IEnumerable<SecurityEntity> Search(string partOfValue, string claimType)
Parameters
Type Name Description
System.String partOfValue

Part of value to match or null to get all of given type.

System.String claimType

The claimType to search for.

Returns
Type Description
System.Collections.Generic.IEnumerable<SecurityEntity>

A list of all matching entities or an empty list if no matches.

Overrides
Remarks

The recommendation is to support partly matches on partOfValue. For example in an implementation that uses SQL server the recommendation is to surround the specified value with '%' and use the 'LIKE' operator.

Search(String, String, Int32, Int32, out Int32)

Searches all security entities of given type with a matching name with paging support.

Declaration
public override IEnumerable<SecurityEntity> Search(string partOfValue, string claimType, int startIndex, int maxRows, out int totalCount)
Parameters
Type Name Description
System.String partOfValue

Part of value to match or null to get all of given type.

System.String claimType

The claim type to search for.

System.Int32 startIndex

The start index, used for paging

System.Int32 maxRows

The maximum number of rows returned

System.Int32 totalCount

The total amount of matched entites. Return -1 if provider does not support paging.

Returns
Type Description
System.Collections.Generic.IEnumerable<SecurityEntity>

A list of all matching entities or an empty list if no matches.

Overrides
Remarks

The recommendation is to support partly matches on partOfValue. For example in an implementation that uses SQL server the recommendation is to surround the specified value with '%' and use the 'LIKE' operator.

Extension Methods