Commit 68e27c83 authored by ale's avatar ale

Add a default LDAP attribute mapping for u2f registrations

parent efdc2eb6
Pipeline #1456 passed with stages
in 1 minute and 21 seconds
......@@ -59,10 +59,12 @@ func (c *LDAPServiceConfig) attributes() []string {
return attrs
}
// The default attribute mapping just happens to match our schema.
var defaultLDAPAttributeMap = map[string]string{
"password": "userPassword",
"totp_secret": "totpSecret",
"app_specific_password": "appSpecificPassword",
"u2f_registration": "u2fRegistration",
}
func (c *LDAPServiceConfig) compile() error {
......@@ -109,7 +111,7 @@ func (c *LDAPServiceConfig) userFromResponse(username string, result *ldap.Searc
EncryptedPassword: []byte(dropCryptPrefix(getStringFromLDAPEntry(entry, c.Attrs["password"]))),
TOTPSecret: getStringFromLDAPEntry(entry, c.Attrs["totp_secret"]),
AppSpecificPasswords: decodeAppSpecificPasswordList(getListFromLDAPEntry(entry, c.Attrs["app_specific_password"])),
U2FRegistrations: decodeU2FRegistrationList(getListFromLDAPEntry(entry, c.Attrs["u2f_registrations"])),
U2FRegistrations: decodeU2FRegistrationList(getListFromLDAPEntry(entry, c.Attrs["u2f_registration"])),
}
return &u, true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment