Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 10.6 errors #45

Merged
merged 2 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion LDAP-Auth/Config/configPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h2 class="sectionTitle">LDAP Settings:</h2>
});
});

document.getElementById("ldapForm").addEventListener("submit", function(_){
document.querySelector(".esqConfigurationForm").addEventListener("submit", function(e){
Dashboard.showLoadingMsg();

ApiClient.getPluginConfiguration(LdapConfigurationPage.pluginUniqueId).then(function (config) {
Expand All @@ -153,6 +153,7 @@ <h2 class="sectionTitle">LDAP Settings:</h2>
config.CreateUsersFromLdap = LdapConfigurationPage.chkEnableUserCreation.checked;

ApiClient.updatePluginConfiguration(LdapConfigurationPage.pluginUniqueId, config).then(Dashboard.processPluginConfigurationUpdateResult);
e.preventDefault();
});

// Disable default form submission
Expand Down
4 changes: 2 additions & 2 deletions LDAP-Auth/LDAP-Auth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace>Jellyfin.Plugin.LDAP_Auth</RootNamespace>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<FileVersion>8.0.0.0</FileVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<FileVersion>9.0.0.0</FileVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>CA1707</NoWarn>
Expand Down
14 changes: 14 additions & 0 deletions LDAP-Auth/LDAPAuthenticationProviderPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,28 @@ public Task<ProviderAuthenticationResult> Authenticate(string username, string p
_logger.LogDebug("Trying bind as user {1}", ldapUser.Dn);
try
{
if (_config.SkipSslVerify)
{
ldapClient.UserDefinedServerCertValidationDelegate += LdapClient_UserDefinedServerCertValidationDelegate;
}

ldapClient.Connect(_config.LdapServer, _config.LdapPort);
if (_config.UseStartTls)
{
ldapClient.StartTls();
}

ldapClient.Bind(ldapUser.Dn, password);
}
catch (Exception e)
{
_logger.LogError(e, "Failed to Connect or Bind to server as user {1}", ldapUser.Dn);
throw new AuthenticationException("Error completing LDAP login. Invalid username or password.", e);
}
finally
{
ldapClient.UserDefinedServerCertValidationDelegate -= LdapClient_UserDefinedServerCertValidationDelegate;
}

if (ldapClient.Bound)
{
Expand Down
2 changes: 1 addition & 1 deletion build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "LDAP Authentication"
guid: "958aad66-3784-4d2a-b89a-a7b6fab6e25c"
version: "8.0.0.0"
version: "9.0.0.0"
targetAbi: "10.6.0.0"
owner: "jellyfin"
overview: "Authenticate users against an LDAP database"
Expand Down