Authorization and Registration (Windows CE 5.0)
Authorization is the process where a user grants a device permission to receive shared content from the computer running Windows Media Connect. Registration is performed after authorization, and it allows devices that support Windows Media DRM 10 for Network Devices to stream protected content from the computer running Windows Media Connect.
Authorization
Windows Media Connect requires each network device to be authorized by the user before it can access content or metadata. The first time a UPnP Media Renderer, UPnP Media Renderer/Control Point combination, or Control Point announces itself or tries to connect to the server, Windows Media Connect will notify the user at the computer with a balloon tip.
After a Windows Media Connect discovers a device, the user must authorize the device on the server. This is done by clicking the Allow button in the WMC application.
UPnP Media Renderers
UPnP Media Renderers are recognized by a combination of MAC address and Unique Device Name (UDN). If a device with a MAC/UDN pair that has not been seen before is discovered, the device is listed as a new device. The device then becomes authorized or not authorized based on user action. After a device is authorized, neither of these numbers can change. If they do, the device will automatically be unauthorized.
UDN
The device must a supply a globally unique UDN. The UDN must be a UTF-encoded string value containing "uuid:" followed by a 128-bit value in hexadecimal form. The maximum length is 68 bytes. The following example illustrates the syntax for the UDN.
uuid:XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXX
Control Points
Control points are recognized by the MAC address only. If a device with a MAC address that has not been seen before is discovered, it is listed as a new device. The device must then be authorized by user action.
Discovering Authorization Status
Windows Media Connect supports a custom service called X_MS_MediaReceiverRegistrar that provides mechanisms for devices to discover their authorization status (see Appendix B).
The service provides an action called IsAuthorized. Media Renderer/Control Point combination devices and Control Points can ask about themselves by calling IsAuthorized and passing in an empty string, as shown in the following example.
IsAuthorized("")
Control Points can ask about the status of another Media Renderer by calling IsAuthorized with the device's UDN.
IsAuthorized(UDN)
Windows Media Connect also supports events for an authorization status change. Devices should subscribe to events from the X_MS_MediaReceiverRegistrar service as they would to any UPnP service. The two evented variables are AuthorizationGrantedUpdateID and AuthorizationDeniedUpdateID.
These events are global. This means that they are sent to all devices with no indication of which device has been granted or denied authorization. Each device must call the IsAuthorized action after receiving the event to determine whether it is the device that had a status change.
Another way of determining authorization status is to call any UPnP action and look at the result. Unauthorized devices will get an 801 error code, as shown in the following example. Authorized devices will get a proper response.
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode >801</errorCode>
<errorDescription >Access Denied</errorDescription>
</UPnPError>
Registration
To access protected content, devices must register with the DRM service. Registration is done with a UPnP action called RegisterDevice.
Windows Media Connect also provides a mechanism for determining the registration status of a device. The X_MS_MediaReceiverRegistrar service contains an action called IsValidated. As with the IsAuthorized action, A Control Point or Control Point/Media Renderer combination device should call IsValidated with an empty string to ask about itself.
IsValidated("")
A Control Point that needs to ask about a Media Renderer should pass in the Media Renderer's UDN.
IsValidated(UDN)
The X_MS_MediaReceiverRegistrar service also supports events for changes in registration status. The two event variables are ValidationSucceededUpdateID and ValidationRevokedUpdateID. When either of these is received and indicates a change, the device should call IsValidated to determine its status.
See Also
Media Query Engine Architecture
Send Feedback on this topic to the authors