onvif http digest 鑑權認證報文流程分析
-------------------------------------------------------------------------------------------------------------------------------------------------------------
POST /onvif/device_service HTTP/1.1
Host: 192.168.0.170
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 299
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDeviceInformation xmlns="http://www.onvif.org/ver10/device/wsdl"/>
</s:Body>
</s:Envelope>
------------------------------------------------------------------------------------------------------------------------------------------------------------
HTTP/1.1 401 Unauthorized
Content-Type: application/soap+xml; charset=utf-8
Connection: close
WWW-Authenticate: Digest realm="Login to 2J01018PAA00816",qop="auth",nonce="b252aWYtZGlnZXN0OjQzMjUzMzYxMzMw", opaque="", stale="false"
------------------------------------------------------------------------------------------------------------------------------------------------------------
POST /onvif/device_service HTTP/1.1
Host: 192.168.0.170
Content-Type: application/soap+xml; charset=utf-8
Authorization: Digest username="admin", realm="Login to 2J01018PAA00816", qop="auth", algorithm="MD5", uri="192.168.0.170", nonce="b252aWYtZGlnZXN0OjQzMjUzMzYxMzMw", nc=00000001, cnonce="1EB4373064AE84535163C0D0A5D83CCC", opaque="", response="2b12aaf4ada356d2965875c854881926"
Content-Length: 299
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDeviceInformation xmlns="http://www.onvif.org/ver10/device/wsdl"/>
</s:Body>
</s:Envelope>
------------------------------------------------------------------------------------------------------------------------------------------------------------
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Connection: close
Content-Length: 622
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema">
<s:Header/>
<s:Body>
<tds:GetDeviceInformationResponse>
<tds:Manufacturer>Dahua</tds:Manufacturer>
<tds:Model>IPC-HDW1025C</tds:Model>
<tds:FirmwareVersion>2.420.Dahua 00.14.R, build: 2016-06-18</tds:FirmwareVersion>
<tds:SerialNumber>2J01018PAA00816</tds:SerialNumber>
<tds:HardwareId>1.00</tds:HardwareId>
</tds:GetDeviceInformationResponse>
</s:Body>
</s:Envelope>
------------------------------------------------------------------------------------------------------------------------------------------------------------