By the way, as we are an Enterprise License customer, I have also sent an email to the volosoft contact email address about the issue. (But didn't have a response yet) If we communicate over there maybe I can give more info as it will not be public.
As this is a commercial project, I would rather not share the project structure. But I can give detail about what you are trying to learn.
In addition, when I try to access the feature (using IFeatureChecker) in a plain controller or app service method it works.
Hi Maliming,
I am trying to access it inside a background hosted service project and inside a QuartzBackgroundWorkerBase derived class. (This is some background project for scheduled tasks.)
Btw, as I look at the source code, both IFeatureChecker and IFeatureManager uses line:
var featureDefinition = FeatureDefinitionManager.Get(name);
and I think this line throws the "Undefined feature" exception. But I don't know why.
public virtual FeatureDefinition Get(string name)
{
Check.NotNull(name, nameof(name));
var feature = GetOrNull(name);
if (feature == null)
{
throw new AbpException("Undefined feature: " + name);
}
return feature;
}
Thank you
Yeap. When considerUow: false, it works!
What is the reason of this behavior? Should I give up on considerUow? But I need it, because I execute this cache update together with some database operation .
Hi maliming,
Thanks for the reply. The situation is:
using (CurrentTenant.Change(null))
{
// GetAsync works on host! It gets cached item from host.
var cachedClient = await _clientCache.GetAsync(identityClient.ClientId);
cachedClient.Enabled = false;
// But SetAsync does not work on host! It adds a new cached item under tenant folder on redis.
// Instead of overwriting the item on host folder.
await _clientCache.SetAsync(identityClient.ClientId, cachedClient, new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = _identityServerOptions.Caching.ClientStoreExpiration
},
considerUow: true);
}
We can customize the LDAP service, but again we need to store the tenant based domain name setting somewhere. I think the current ldap login settings page is the best place for it, isn't it?
Hi maliming,
I don't have any official documentation right now, explaining that we should use domain name. Maybe it could be found after a deep research. But when I try ldap bind without the domain name (just the username itself) I get the following error:
Invalid Credentials. Invalid Credentials. Result: 49. Method: ldap_parse_result. Details: errorMessage: 80090308: LdapErr: DSID-0C090447, comment: AcceptSecurityContext error, data 52e, v3839 matchedMessage:
And when I search the error, I saw that many people resolve this error by appending the domain name to the user name when making ldap bind. And when I append the domain name, problem is solved.
Examples:
https://stackoverflow.com/a/52474797/ https://stackoverflow.com/a/52725355/ https://stackoverflow.com/a/53442129/ https://stackoverflow.com/a/56896250/ https://stackoverflow.com/a/60112692/ https://stackoverflow.com/a/31692694/ https://stackoverflow.com/a/31692694/
Hi maliming, thanks for the response. But I didn't get what you mean by saying domain\user is a good solution.
Active Directory requires domain name with user name, but abp's ldap settings page do not have any domain name parameter, so as of now abp's ldap login feature cannot be used properly at least with default settings capabilities (I know that we can override methods to normalize user names, but it should not be hard-coded, and also be stored tenant based). I think it would be great to have domain name setting added to ldap login settings page in the next versions. Do you have any plans for that.