DigDes/SoapCore

How to enable user and password protection (WSS)?

seyama-daisuke opened this issue · 2 comments

Thank you for this great application developpers.

I want to enable user/password protection on SOAP server that used this SoapCore.

I checked some tech blog and this site, but I did not understand how to that.

Could you please?

I've never used it myself, but if I'm correct you can use `.AddSoapWsSecurityFilter(username, password) to enable this.
If you need another behavior you can implement your own filter.

See

public static IServiceCollection AddSoapWsSecurityFilter(this IServiceCollection serviceCollection, string username, string password)
{
return serviceCollection.AddSoapMessageFilter(new WsMessageFilter(username, password));
}

https://github.com/DigDes/SoapCore/blob/develop/src/SoapCore/WsMessageFilter.cs
https://github.com/DigDes/SoapCore/blob/develop/src/SoapCore.Tests/MessageFilter/WsMessageFilterTests.cs

Thank you @andersjonsson san!
With the information you gave me, I was able to enable it without any problem.