OK SOLVED :)
I created my custom config and enable correctly, LDAP support . Works perfect !! Thank you!
Ok tahnks works. I´m aldo traing LDAP auth:
In my core module in PreInitialize method I call this:
IocManager.Register<ILdapSettings, MNDLdapSettings>(); //change default setting source
Configuration.Modules.ZeroLdap().Enable(typeof(MyLdapAuthenticationSource));
I have also class:
public class MyLdapAuthenticationSource : LdapAuthenticationSource<Tenant, User>
{
public MyLdapAuthenticationSource(ILdapSettings settings, IAbpZeroLdapModuleConfig ldapModuleConfig)
: base(settings, ldapModuleConfig)
{
}
}
Then i Created this settings class:
public class MNDLdapSettings : ILdapSettings
{
public async Task<bool> GetIsEnabled(int? tenantId)
{
return true;
}
public async Task<ContextType> GetContextType(int? tenantId)
{
return ContextType.Domain;
}
public async Task<string> GetContainer(int? tenantId)
{
return "";
}
public async Task<string> GetDomain(int? tenantId)
{
return "domain";
}
public async Task<string> GetUserName(int? tenantId)
{
return "name";
}
public async Task<string> GetPassword(int? tenantId)
{
return "pass";
}
}
I also tried use your default setting like you noted:
Note: If you don't define domain, username and password, LDAP authentication works for current domain if your application runs in a domain with appropriate privileges.
And try enable LDAP like in this post / last unanswered question: #205@a9e9ccf7-5841-4126-9423-c0d5b678eb9b
But no work , the same problem with : Abp.AbpException: There is no setting defined with name: Abp.Zero.Ldap.IsEnabled
When is LDAP enablet and in cotroller is [AbdAuthorized] attribute. User will be logged automaticly ?
Please help ... Thnaks!
But auth no work for me, how can I detect error in credectials etc or debug auth using LDAP ? Thnaks
Ok I used your basic sample, with simply retun true. I registered this MyExternalAuthSource, in Web project.
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
public class MyExternalAuthSource : DefaultExternalAuthenticationSource<Tenant, User>
{
public override string Name
{
get { return "MyCustomSource"; }
}
public override async Task<bool> TryAuthenticateAsync(string userNameOrEmailAddress, string plainPassword, Tenant tenant)
{
//TODO: authenticate user and return true or false
return true;
}
}
But i dont know what i must tu do next for login person by using this external source. In documentation this is missing and I´m confused . What i must change in Login method in auth controller ?
I algo got this error:
No component for supporting the service TT.MyExternalAuthSource was found
Popis: Při provádění aktuálního webového požadavku došlo k neošetřené výjimce. Další informace o chybě a o jejím původu v kódu naleznete v trasování zásobníku.
Podrobnosti o výjimce: Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service TT.MyExternalAuthSource was found
Ok I solved this by add this code to intialization of Core Module:
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
IocManager.Register<MyExternalAuthSource>(DependencyLifeStyle.Transient);
}
Mayby another question. I notice that when use Custom auth login, AbpUser table automaticly create new record for logged person name and also generate password. Is this appropoach good for my situation ( I have onother table with users) so roles and other stuff are still depended on AbpUser ?
Thnaks for any tip!
Thanks for reply! Let´s assume that I need to use different table than AbpUser for login check, how would you preoceed ? For login to apllication is windows username needed, if username is in DB , then user is logged. Thats all..
By the way Views is possible to map...
Thanks !
Hello, i often need to use another table for users, mostly is a VIEW from another system like Active Directory. Is is possible to have custom View table for users and using role, permission and another good functionality of ABP ?
My poople view look like:
PeopleView: Login, Department, Email with thousands of row.
User will be automaticly logged to system by his login - Windows Auth.
Do anybody have the same problem ?
Thanks !
Works, thanks !!
Hello,
I need to override default SMTP server setting configuration. I created this class:
public class MySettingProvider : SettingProvider
{
public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
{
return new[]
{
new SettingDefinition(
"SmtpServerAddress",
"192.168.50.14"
)
};
}
}
And in Web.Module I´m calling this:
public override void PreInitialize()
{
Configuration.Settings.Providers.Add<MySettingProvider>();
}
But this no work! What is correct appropoach to do it ? Thnaks !
I checked this document, tried this:
Configuration.Localization.Sources.Extensions.Add(
new LocalizationSourceExtensionInfo("AbpWeb",
new XmlFileLocalizationDictionaryProvider(
HttpContext.Current.Server.MapPath("~/Localization/AbpWebExtensions")
)
)
);
And overide the names in resource file, but it dont work.
Thnaks for tips!
Hello, how locallize sweet alerts buttons ? I found in code this:
abp.event.on('abp.dynamicScriptsInitialized', function () {
abp.libs.sweetAlert.config.confirm.title = abp.localization.abpWeb('AreYouSure');
abp.libs.sweetAlert.config.confirm.cancelButtonText = abp.localization.abpWeb('Cancel');
abp.libs.sweetAlert.config.confirm.confirmButtonText = abp.localization.abpWeb('Yes');
});
Where are this rosources ? In Localization AbpWeb resource is missing... Thnaks for help !
Hello,
I have problem with using KENDO UI componets with ABP. I have test home controller :
public ActionResult CategoriesRead([DataSourceRequest]DataSourceRequest request)
{
List<Work> lissOfWorks = new List<Work>() {
new Work { Name = "Martin", SureName = "HAHA1", ProjectName = "Projekt A", Date = DateTime.Today },
new Work { Name = "Ondřej", SureName = "HAHA2", ProjectName = "Projekt B", Date = DateTime.Today },
new Work { Name = "Tomáš", SureName = "HAHA3", ProjectName = "Projekt A", Date = DateTime.Today },
new Work { Name = "Lukáš", SureName = "HAHA4", ProjectName = "Projekt B", Date = DateTime.Today },
};
DataSourceResult result = lissOfWorks.ToDataSourceResult(request, work => new {
work.Name,
work.SureName,
work.ProjectName,
});
return Json(result);
}
In home view this:
@(Html.Kendo().Grid<BB.BB.Web.Models.Work>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(work => work.Name);
columns.Bound(work => work.SureName);
columns.Bound(work => work.ProjectName);
})
.DataSource(dataSource =>
dataSource.Ajax().Read(read => read.Action("CategoriesRead", "Home"))
)
.Pageable() // Enable paging
.Sortable() // Enable sorting
)
ABP covert ajax response with custom wrapper data and GRID no work:
error: null
result: {data: [{name: "Ondřej", sureName: "HAHA1", projectName: "Projekt A"},…], total: 4,…}
success: true
unAuthorizedRequest: false
The response should look like this:
AggregateResults: null
Data: [{Name: "Ondřej", SureName: "Pětník", ProjectName: "HAHA1 B"},…]
Errors: null
Total: 4
How solve this issue ? thanks !