4.1 UPnP Authorization

The following example shows the authorization procedure between a receiver and a transmitter.

Receiver to Transmitter

 POST /upnphost/udhisapi.dll?control=uuid:a7e63d3b-0a14-4143-b997-3cd79e20766b+urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar HTTP/1.1
 Content-Type: text/xml; charset="utf-8"
 SOAPAction: "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1#IsAuthorized"
 User-Agent: Mozilla/4.0 (compatible; UPnP/1.0; Windows 9x)
 Host: 192.168.3.106:2869
 Content-Length: 401
 Connection: Keep-Alive
 Cache-Control: no-cache
 Pragma: no-cache
  
 <?xml version="1.0"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:IsAuthorized xmlns:m="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"><DeviceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string"></DeviceID></m:IsAuthorized></SOAP-ENV:Body></SOAP-ENV:Envelope>

The receiver sends its DeviceID to the transmitter and the transmitter responds to the receiver with a 1 if the receiver is currently authorized, or a 0 if the receiver is not authorized.

Transmitter to Receiver

 HTTP/1.1 200 OK
 Content-Length: 411
 Content-Type: text/xml; charset="utf-8"
 Server: Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0 Microsoft-HTTPAPI/1.0
 Date: Wed, 07 Jul 2004 00:38:23 GMT
  
 <?xml version="1.0"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:IsAuthorizedResponse xmlns:m="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"><Result xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="int">1</Result></m:IsAuthorizedResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

For more information on IsAuthorized, see section 3.4.6.3.1.