Closed Cussa closed 6 years ago
So that we can add Bearer Tokens to the request headers? (That would have been my next question actually.)
Yes. My idea is to create methods to add any kind of authentication. So, bearer tokens will be fully supported.
https://www.nuget.org/packages/HodStudio.XitSoap/2.1.0.2-beta
//Create your service var webService = new WebService("url", "namespace");
//If you want to use Basic Authentication webService.SetAuthentication(new BasicAuthentication("user", "password"));
//If you want to use Bearer Token Authentication webService.SetAuthentication(new BearerTokenAuthentication("yourtoken"));
//Invoke the method webService.Invoke("IsAlive", "IQuotaDistributionService");
If you want to create your own authentication mode, create a class and inherits it from the IAuthentication interface. Implements the property AuthenticationHeader to have what exactly you want!
If you need to add another information on the header, you can use now the AddHeader method. And if it's necessary to remove, you can use the RemoveHeader!
Hope that it helps!
@maracuja-juice if you can test it, please, let me know about the feedback! ;)
@Cussa I only tested the Bearer Authentication:
webService.SetAuthentication(new BearerTokenAuthentication("yourtoken"));
And that works perfectly.
Perfectly! I'll try to find some public webservice with basic authentication to test it. If everything is ok, I'll release the version.
As everything seems ok, I'm preparing the documentation to it and I'll release the version 2.1.0! 😃
Merging to production!
Improve the library creating a way to provide the Authentication on it.