Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #554, #5288
Since I also needed it, I added support for LDAP / Windows Active Directory. I was only able to test it within our company with our companies AD. To use it, you have to configure the
Auth.LdapUser
block in theWeb.config
file.When
Auth.LdapUser.Enabled
, the register form is used to check the given credentials (username and password) and if the credentials are valid, it creates a new account with the username asldap.user
credentials instead of saving the password withpassword.v3
credentials. No password credentials will be created for this account. If you want to useLdapUser
with the current password asLocalUser
fallback, you can just add the credentials to the account inAuthenticationService.cs
right after theCreateIdentity
was called (around line 252). This may be something to make configurable.If you only want to support LDAP without regular passwords (i.e. when you are setting up a new server), I advise you to set
Auth.LocalUser.Enabled
inWeb.config
tofalse
. They can coexist, since they both have an own cookie, but in most cases, you really only want to have either LDAP or local users.Right now, there is no migration path to change existing user credentials from
password.v3
toldap.user
. In case the NuGet username already matches the LDAP username, the easiest way would be to update thedbo.Credentials
entries forpassword.v3
and setType
=ldap.user
andValue
=(SELECT [Username] FROM [Users] WHERE [Key] = [UserKey])
.Tests are currently missing. I didn't want to put in the effort in case that it won't be merged. So I will add them, in case that there are no points speaking against merging.