次の方法で共有


RMGetLicense.GetLicenseFromURL

banner art

Previous Next

RMGetLicense.GetLicenseFromURL

The GetLicenseFromURL method sends a license request and retrieves a license. Use this method when predelivering a license.

Syntax

  GetLicense
  .GetLicenseFromURL (
  bstrHeader
  , bstrURL)

Parameters

bstrHeader

[in] String containing the consumer portion of a license request. If you do not want to use a content header, you can send an empty or NULL string.

bstrURL

[in] String containing a URL. The license challenge data is sent to this URL using an HTML POST.

Return Values

This method does not return a value.

Remarks

The GetLicenseFromURL method calls the RMGetLicense.GetSystemInfo method to retrieve the Windows Media Rights Manager portion of a license request and combines it with the user portion before sending the combined string to the license issuer.

To send the user portion of a license request in a secure manner, bstrHeader must be a properly formatted content header. If it is not, the license issuer will not be able to retrieve the necessary information. You can use the WMRMHeader object to create the header, which should contain a key ID and any other information you want to add. The license acquisition URL can be a dummy value because the bstrURL parameter is the actual URL. If you do not want to pass a content header, you can include the key ID as part of the bstrURL (for example, append ?KID=abc).

The license issuer must do the following:

  1. Create a WMRMChallenge object.
  2. Retrieve the header using the WMRMChallenge.Header property.
  3. Set the header into a WMRMHeader object.
  4. Use the properties of that object to retrieve the information.

The header includes double quotation marks (") from the HTML code created by the server-side script. When passing this string as a parameter to the GetLicenseFromURL method, replace each instance of a double quotation mark (") with either a single quotation mark (') or a backslash and quotation mark (\"). A standard scripting language function, such as Replace() in Microsoft® Visual Basic® Scripting Edition (VBScript), can be used to do this.

When the license request is received, the challenge blob is similar to the challenge from a player and the header can be retrieved by using the WMRMChallenge object. However, the version 1 challenge is not sent as part of the version 10 challenge, so you cannot use this method to predeliver version 1 licenses.

Requirements

Version: Windows Media Rights Manager 7 SDK or later

Reference: msnetobj 1.0 Type Library

Library: msnetobj.dll

Platform: Windows Server 2003

See Also

Previous Next

© 2007 Microsoft Corporation. All rights reserved.