Skip to main content

Microsoft Silverlight

Answered Question Silverlight & Authorization plugin for Windows Media Services - Referral URLRSS Feed

(0)

uthay
uthay

Member

Member

0 points

1 Posts

Silverlight & Authorization plugin for Windows Media Services - Referral URL

Hi

I'm trying  an Authorization plugin for WMS to validate referral URL from UserContext, it means, WMService will stream only to  request come from particular website, plugin wrote in C# and its WORKING fine with embedded Windows Media Player 9 or later.

now testing the same plugin against embedded Silverlight (ver 2.0/ASP.Net 3.5) Mediaplayer (  <asp:MediaPlayer ... )   its seems Silverlight player is not sending the Referral URL??***  to WMServices (windows 2003 Enterprise)

i'm Authorizing only at WMS_EVENT_PLAY, its working fine with WMP but Silverlight Player throwing some error

System.Runtime.InteropServices.COMException (0x8002000B): Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
   at Microsoft.WindowsMediaServices.Interop.IWMSContext.GetStringValue(String pstrName, Int32 lNameHint, String& pstrValue, Int32 lOptions)
   at MyWMSNameSpace.MyWMSAuthorizationPlugin.Microsoft.WindowsMediaServices.Interop.IWMSEventAuthorizationPlugin.AuthorizeEvent(WMS_EVENT& i__Event, IWMSContext io__UserContext, IWMSContext io__PresentationContext, IWMSCommandContext io__CommandContext, IWMSEventAuthorizationCallback i__ServerCallback, Object i__Context)


i tried some other events like WMS_EVENT_OPEN , WMS_EVENT_CONNECT but WMP itself throwing error.

what i'm looking for is,

1) i want to clarify whether Silverlight supports Referral URL info to WMServices??
2)  if yes then at Which Event is sending the info to WMService
3) or i'm making any mistake in Authorizing  or in  Event Handling  because i'm getting error in my plugin for other Events


here is the main part of the code
------------------------------------------------------------------------------------

//Identify the events the plug-in can authorize
 object IWMSEventAuthorizationPlugin.GetAuthorizedEvents()
        {
                WMS_EVENT_TYPE[] l__AuthorizeEvents ={WMS_EVENT_TYPE.WMS_EVENT_PLAY};
                return (object) l__AuthorizeEvents;          
         }


void IWMSEventAuthorizationPlugin.AuthorizeEvent
            (
                    ref WMS_EVENT i__Event,
                    IWMSContext io__UserContext,
                    IWMSContext io__PresentationContext,
                    IWMSCommandContext io__CommandContext,
                    IWMSEventAuthorizationCallback i__ServerCallback,
                    object i__Context
            )
        {

   string l__URLRefererString = string.Empty;
                io__UserContext.GetStringValue
                    (
                        WMSDefines.WMS_USER_REFERER,
                        WMSDefines.WMS_USER_REFERER_ID,
                        out l__URLRefererString,
                        0
                    );
  

              if (l__URLRefererString == "MyWebsite")
                {
                   // value of ACCESS.
                }
                else
                {
                    // value of ACCESSDENIED.                
                }
       }

-------------------------------------------------------------------------------------------------------------------------------------

 Note *** : i think i have answer for my own question 1,  When i checked the WMServices Client Log , i could see the Referral URL entry for Silverlight Embedded page.


Any suggestions

Thanks in advance

- Uthay
  www.uk-softsolutions.com

bryant
bryant

Star

Star

9927 points

1,629 Posts

Silverlight MVP
Answered Question

Re: Silverlight & Authorization plugin for Windows Media Services - Referral URL

All Silverlight requests are made through the browser, so it should pass along all the same information as normal browser requests.

-- bryant

Blog | Twitter
_________________
Dont forget to click "Mark as Answer" on the post that helped you.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities