Ldap logout throws errors
Hello kz,
Thank you for using our services.
This is a know issue, which we have identified in the RC. It is logged for fixing, however I can not give you a time frame for the fix.
All the best,
Radoslav Georgiev
the Telerik team
Greetings,
|
|
Hello Daniel,
Thank you for joining the conversation.
When logging out with your control can you please double check if the Security manager is instantiated with your custom provider. From the stack trace it seems that the Security manager is executing for the default provider, and if your user does not exist there you will get a null reference exception.
All the best,
Radoslav Georgiev
the Telerik team
Hello Rodaslov,
<
roleProviders
>
<
add
description
=
"TestSite Custom Role Data Provider"
resourceClassId
=
""
type
=
"TestSite.Website.Core.TestSiteRoleDataProvider"
type:type
=
"System.RuntimeType, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
applicationName
=
"TestSite/"
enabled
=
"True"
name
=
"TestSite"
/>
</
roleProviders
>
<
membershipProviders
>
<
add
description
=
"TestSite Custom Membership Data Provider"
resourceClassId
=
""
type
=
"TestSite.Website.Core.TestSiteMembershipDataProvider"
type:type
=
"System.RuntimeType, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
applicationName
=
"TestSite/"
enabled
=
"True"
name
=
"TestSite"
/>
</
membershipProviders
>
public class DocnectionMembershipDataProvider : MembershipDataProvider
public override User CreateUser(string userName) throw new NotImplementedException();
public override User CreateUser(Guid id, string userName) throw new NotImplementedException();
public override User GetUser(Guid id)
using (var ctx = ConfigMgr.Instance.ORMContextFactory.CreateORMContext())
var user = new User();
var userEntity = new UserEntity
UserKey = id
;
if (ctx.Adapter.FetchEntityUsingUniqueConstraint(userEntity, userEntity.ConstructFilterForUCUserKey()))
user.ApplicationName = "TestSite/";
user.Id = userEntity.UserKey;
user.FirstName = userEntity.FirstName;
user.LastName = userEntity.LastName;
user.Email = userEntity.Email;
user.SetCreationDate(userEntity.CreationDate);
user.SetUserName(userEntity.Username);
user.ManagerInfo = new ManagerInfo
ProviderName = "TestSite",
ApplicationName = "TestSite/"
;
return user;
public override IQueryable<
User
> GetUsers() // Code Removed
public override void Delete(User item) // Code Removed
public override bool ValidateUser(Guid userId, string password) // Code Removed
public override bool ValidateUser(string userName, string password) // Code Removed
public override bool ValidateUser(User user, string password) return ValidateUser(user.Id, password);
public override void RollbackTransaction()
// Empty but I had it empty also on the BETA version
public override void FlushTransaction()
// Empty but I had it empty also on the BETA version
protected override object CreateNewTransaction(string transactionName)
return null;
protected override object GetTransaction()
return null;
public override void CommitTransaction()
// Empty but I had it empty also on the BETA version
var userManager = UserManager.GetManager("TestSite");
userManager.Provider.SuppressSecurityChecks = true;
if (!userManager.ValidateUser(TextBoxUsername.Text, TextBoxPassword.Text))
if (LabelIncorrectCredentials != null)
LabelIncorrectCredentials.Visible = true;
return;
var user = userManager.GetUser(TextBoxUsername.Text);
SecurityManager.SetAuthenticationCookie(SystemManager.CurrentHttpContext.Response, "TestSite", TextBoxUsername.Text, CheckBoxRememberMe != null ? CheckBoxRememberMe.Checked : false);
SecurityManager.Logout();
SystemManager.CurrentHttpContext.Response.Redirect(homePageUrl);
Hello Daniel,
Thank you for providing all the needed information.
The problem which you are experiencing is not related to the LDAP provider bug. Since your membership provider is inheriting from the MembershipDataProvider class you need to implement an interface for the IOpenAccessDataProvider interface. This is so because the MembershipDataProvider class is meant to work with OpenAccess for data persistence.
Greetings,
Radoslav Georgiev
the Telerik team
Greetings,