Implementing my own Authentication - HodStudio/XitSoap GitHub Wiki

XitSoap is only providing two types of authentication: Basic and Bearer Token. But it's not limited to that! You can create your own Authentication method!

Basically, you have to create a class and implements the IAuthentication interface. This interface just have a property called AuthenticationHeader. When XitSoap invokes the webService, it will add this property on the header Authentication. So, you need to provide the type.

Bearer Token Authentication (for example)

namespace HodStudio.XitSoap.Authentication
{
    public class BearerTokenAuthentication : IAuthentication
    {
        public BearerTokenAuthentication(string token)
        {
            Token = token;
        }

        public string Token { get; set; }

        public string AuthenticationHeader
        {
            get { return $"Bearer {Token}"; }
        }
    }
}