Class PhpCompatibleAuthenticator
- Namespace
- WINKOnvif.Core.Authentication
- Assembly
- WINKOnvif.Core.dll
Authenticator compatible with PHP implementation that uses specific timestamp format with milliseconds and different password digest calculation method
public class PhpCompatibleAuthenticator : IAuthenticator
- Inheritance
-
PhpCompatibleAuthenticator
- Implements
- Inherited Members
Constructors
PhpCompatibleAuthenticator(ILogger<PhpCompatibleAuthenticator>)
public PhpCompatibleAuthenticator(ILogger<PhpCompatibleAuthenticator> logger)
Parameters
loggerILogger<PhpCompatibleAuthenticator>
Methods
ApplyAuthentication(XmlDocument, OnvifCredentials)
public void ApplyAuthentication(XmlDocument soapRequest, OnvifCredentials credentials)
Parameters
soapRequestXmlDocumentcredentialsOnvifCredentials
ApplyAuthentication<TClient, TContract>(TClient, OnvifCredentials)
Applies authentication to a SOAP client
public void ApplyAuthentication<TClient, TContract>(TClient client, OnvifCredentials credentials) where TClient : ClientBase<TContract> where TContract : class
Parameters
clientTClientThe client to apply authentication to
credentialsOnvifCredentialsCredentials to use for authentication
Type Parameters
TClientType of the client
TContractType of the service contract
GenerateWsseSecurityHeader(OnvifCredentials)
Generates the WSSE Security XML fragment to be inserted into the SOAP header. Uses the PHP-compatible format with milliseconds in timestamp.
public string GenerateWsseSecurityHeader(OnvifCredentials credentials)
Parameters
credentialsOnvifCredentials
Returns
GetAuthHeaderAsync(HttpRequestMessage, OnvifCredentials)
Gets authentication header for HTTP requests
public Task<AuthenticationHeaderValue> GetAuthHeaderAsync(HttpRequestMessage request, OnvifCredentials credentials)
Parameters
requestHttpRequestMessageThe HTTP request to authenticate
credentialsOnvifCredentialsCredentials to use for authentication
Returns
- Task<AuthenticationHeaderValue>
Authentication header value