-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Message Level Security to SoapService
- Loading branch information
1 parent
b21b3b2
commit 1ed7529
Showing
13 changed files
with
217 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.ServiceModel; | ||
using System.IdentityModel.Tokens; | ||
using System.Security.Principal; | ||
using Microsoft.Practices.Unity; | ||
using Microsoft.Practices.Unity.Configuration; | ||
using Heli.Scada.BLInterfaces; | ||
using System.Configuration; | ||
using log4net; | ||
|
||
|
||
namespace Heli.Scada.SoapService | ||
{ | ||
public class CustomUsernameValidator : System.IdentityModel.Selectors.UserNamePasswordValidator | ||
{ | ||
public static readonly ILog log = LogManager.GetLogger(typeof(CustomUsernameValidator)); | ||
public override void Validate(string userName, string password) | ||
{ | ||
try | ||
{ | ||
if (userName == null || password == null) | ||
{ | ||
throw new ArgumentNullException(); | ||
} | ||
IUnityContainer container = new UnityContainer(); | ||
UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity"); | ||
section.Configure(container); | ||
IEngineerBL rservicebl = container.Resolve<IEngineerBL>(); | ||
|
||
if (!rservicebl.validateEngineer(userName, password)) | ||
{ | ||
throw new FaultException("Incorrect Username or Password"); | ||
} | ||
} | ||
catch (Exception exp) | ||
{ | ||
log.Error("Fehler bei Validierung des Engineers via Soap."); | ||
throw new Exception("Fehler bei Validierung des Engineers via Soap.", exp); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> | ||
<Profiles> | ||
<Profile Name="(Default)" /> | ||
</Profiles> | ||
</SettingsFile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters