diff --git a/song_of_the_day/Auth/IAuthenticationService.cs b/song_of_the_day/Auth/IAuthenticationService.cs index 5b48778..7b0481b 100644 --- a/song_of_the_day/Auth/IAuthenticationService.cs +++ b/song_of_the_day/Auth/IAuthenticationService.cs @@ -1,4 +1,4 @@ -public interface IAuthenticationService -{ - bool Authenticate(string userName, string password); +public interface IAuthenticationService +{ + bool Authenticate(string userName, string password); } \ No newline at end of file diff --git a/song_of_the_day/Auth/PhoneClaimCodeProviderService.cs b/song_of_the_day/Auth/PhoneClaimCodeProviderService.cs index eff27d5..d4f1694 100644 --- a/song_of_the_day/Auth/PhoneClaimCodeProviderService.cs +++ b/song_of_the_day/Auth/PhoneClaimCodeProviderService.cs @@ -34,7 +34,7 @@ public class PhoneClaimCodeProviderService SignalIntegration.Instance.SendMessageToUserAsync("Your phone number validation code is: " + generatedCode, phoneNumber); } - + public string ValidateClaimCodeForUser(string code, string username) { var result = false; @@ -50,7 +50,7 @@ public class PhoneClaimCodeProviderService return string.Empty; } - + public bool IsCodeGeneratedForUser(string username) { return _phoneClaimCodes.ContainsKey(username); diff --git a/song_of_the_day/Config/AppConfiguration.cs b/song_of_the_day/Config/AppConfiguration.cs index f121394..707166c 100644 --- a/song_of_the_day/Config/AppConfiguration.cs +++ b/song_of_the_day/Config/AppConfiguration.cs @@ -19,7 +19,8 @@ public class AppConfiguration this.AverageDaysBetweenRequests = int.Parse(Environment.GetEnvironmentVariable("AVERAGE_DAYS_BETWEEN_REQUESTS") ?? "2"); var managersGroupName = Environment.GetEnvironmentVariable("LDAP_ADMINGROUP") ?? "admins"; var userGroupName = Environment.GetEnvironmentVariable("LDAP_USERGROUP") ?? "everybody"; - this.LDAPConfig = new ConfigurationAD() { + this.LDAPConfig = new ConfigurationAD() + { Username = Environment.GetEnvironmentVariable("LDAP_BIND") ?? "cn=admin,dc=disi,dc=dev", Password = Environment.GetEnvironmentVariable("LDAP_PASS") ?? "adminPass2022!", Port = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("LDAP_BIND")) ? int.Parse(Environment.GetEnvironmentVariable("LDAP_BIND")) : 389, @@ -91,7 +92,8 @@ public class AppConfiguration get; private set; } - public ConfigurationAD LDAPConfig { + public ConfigurationAD LDAPConfig + { get; private set; } } \ No newline at end of file diff --git a/song_of_the_day/LDAPIntegration/LdapIntegration.cs b/song_of_the_day/LDAPIntegration/LdapIntegration.cs index 9db34c4..a752701 100644 --- a/song_of_the_day/LDAPIntegration/LdapIntegration.cs +++ b/song_of_the_day/LDAPIntegration/LdapIntegration.cs @@ -107,9 +107,10 @@ public class LdapIntegration var userList = new List(); - foreach(SearchResultEntry result in response.Entries) + foreach (SearchResultEntry result in response.Entries) { - userList.Add(new LdapUser() { + userList.Add(new LdapUser() + { UserId = result.Attributes["uid"][0].ToString(), FirstName = result.Attributes["givenName"][0].ToString(), LastName = result.Attributes["sn"][0].ToString(), diff --git a/song_of_the_day/Program.cs b/song_of_the_day/Program.cs index b3f55b8..9ed8b4b 100644 --- a/song_of_the_day/Program.cs +++ b/song_of_the_day/Program.cs @@ -124,7 +124,7 @@ ldapAssociationTimer.OnOccurence += async (s, ea) => foreach (var user in nonAssociatedUsers) { user.AssociationInProgress = true; - + startUserAssociationProcess(user); user.IsIntroduced = true; needsSaving = true;