Skip navigation
Lei Gu
Currently Being Moderated

Can I pass username/password to Strobe playback as parameters?

Jul 28, 2010 7:43 AM

A question related to single sign on.

Can I pass username/password to Strobe playback as parameters so user doesn't need to be prompted for username/password for protected content? In other words, Strobe detects the need for authentication, but instead putting up a dialog box to prompt the user, it just extracts the passed in username/password and passes it along to the license server?

 

If no such feature is available, can someone point to a simple plug-in sample, where I can pass along username/password or a token to the license server, perhaps through the connection or stream object? I have looked at the Akamai example and it is fairly complicated with little documentation.

Thank you for your help in advance.

-- Leki

 
Replies
  • Currently Being Moderated
    Jul 28, 2010 11:06 AM   in reply to Lei Gu

    Lei,

     

    Curious,  why would you want to pass the default user/pass to authentication? Doesn't that mean you wouldn't need the auth at all? If so, wouldn't it be an option to use anonymouse encrypted content instead?

     

    One way to do this would be possibly to overwrite the Auth dialog with the fault text in it when DRMState. AUTHENITCATION_NEEDED.

     

    Ryan

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 28, 2010 12:15 PM   in reply to Lei Gu

    Lei,


    If SMP allows overwriting "auth dialog", then I think you can write a plugin to do so in SMP level.  For that matter, Andrian would be a good person to talk to.

    Doing this in OSMF to use it in SMP wouldn't seem to be a way to do so, although there is a way to do it, something like below.

     

    In MediaPlayer level, there is "authenticated" function that passes username and password, and "authenticated with token".

    Also drmState should tell you what state of your encrypted media is.

    In your plugin, listens to DRMEvent . If DRMState is AUTHENTICATION_NEEDED, Pop up your auth dialog with your user/pass login.

     

    mediaElement.addEventListener(MediaElementEvent.TRAIT_ADD, onTraitAdd);

     

    private function onTraitAdd(event:MediaElementEvent):void
                   {
                       switch (event.traitType)
                       {

                        case MediaTraitType.DRM:

                            _contentProtectionTrait = mediaPlayer.media.getTrait(MediaTraitType.DRM) as DRMTrait;

                           _contentProtectionTrait.addEventListener(DRMEvent.DRM_STATE_CHANGE, onDRMStateChange);

     

    ...............

     

                private function onDRMStateChange(event:DRMEvent):void
                {
                    var drmState:String = event.drmState.toString();
                   
                    switch(drmState)
                    {

                           case DRMState.AUTHENTICATION_NEEDED:
                       
                            var authDialog:AuthDialog = new AuthDialog();
                            authDialog.drmTrait = _contentProtectionTrait;
                            authDialog.metadata = event.target.drmMetadata as DRMContentData;

     

     

    In your dialog, use authenticate(username, password) when a user tries to attempt auth.  something like this.

     

        private function attemptAuth(event:MouseEvent):void
            {
                drmTrait.addEventListener(DRMEvent.DRM_STATE_CHANGE, onDRMStateChange);
                drmTrait.authenticate(username.text, password.text);
                PopUpManager.removePopUp(this);
            }

     

     

    Ryan

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 29, 2010 6:29 AM   in reply to Lei Gu

    Hi Lei,

     

    It is possible to create a plugin for this too. I created a sample plugin for to get started. Take the source code from here:

    http://smpfmp.appspot.com/SingleSignOnPlugin.zip (I'll commit the code either to the OSMF or the SMP code repository later).

     

    For testing you need to:

    1. point the URL to an encrypted content

    2. instruct FMP/SMP to load the plugin

    3 & 4. set the username and password as plugin metadata

     

    http://fpdownload.macromedia.com/strobe/FlashMediaPlayback.swf?src=htt p://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaAposto l_640_500_short.flv

    &plugin_sso=http://smpfmp.appspot.com/SingleSignOnPlugin.swf

    &sso_username=usernamevalue

    &sso_password=passwordvalue

     

    Under the hood, the plugin will read the metadata, it will block the DRMTrait and will do the authentication itself. The player will not be aware that a DRM trait is avaiable at all, so it will not display the Auth Dialog.

     

    Looking forward to your reply,

    -Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2010 5:38 AM   in reply to Lei Gu

    Hi Lei,

     

    If multiple videos in a SMIL SEQuence require exactly the same username and password, the plugin should work as it is.

     

    If this is broken, you need to trace inside the plugin and see what goes wrong (I suspect I didn't clean-up properly an event handler or over-cleaned them).

     

    If you have a SMIL asset available it should be easy for you to trace this. Currently I'm heads down working on the new StrobeMediaPlayback features and won't be able to look at this during the next 3 weeks.

     

    Let me know if you encounter any issues troubleshooting this.

     

    Thank You,

    Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 11, 2010 8:08 AM   in reply to Lei Gu

    Hi Lei,

     

    The SMILPlugin seems to have a bug when used together with a proxy plugin.

     

    Please follow these steps:

     

    1. Check-out the SMILPlugin source code: http://opensource.adobe.com/svn/opensource/osmf/trunk/plugins/samples/ SMILPlugin

    2. Open the SMILMediaGenerator class.

    3. Go to line 123. You should see the following snippet:

     

    if (!isNaN(duration) && duration > 0)

    {

         (videoElement as VideoElement).defaultDuration = duration;

    }

    4. Replace it with this snippet:

     

    if (!isNaN(duration) && duration > 0)

    {

           // Assuming that videoElement is a VideoElement is wrong (I suppose we can find a better name for this variable?)

           // since any proxy plugin will break this code. Iterating through the proxy chain until we get to a VideoElement

           // We can add some deffensive code just after the while iterator, unless we should always have a VideoElement on top.

           var temp:MediaElement = videoElement;

    while (temp is ProxyElement)

    {

    temp = (temp as ProxyElement).proxiedElement;

    }

    (temp as VideoElement).defaultDuration = duration;

    }

    5. Check that everything works with this patch.

    6. Let us know if this fixes the current issue.

    7. Log the bug and submit the patch (with a link to this forum post) here: http://bugs.adobe.com/jira/browse/FM

     

     

    Thank You,

    Andrian

     

    Message was edited by: Andrian Cucu updated the snipet so that is uses a temp var

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 11, 2010 8:29 AM   in reply to Andrian Cucu

    Thanks Andrian for digging int this!

     

    Yes, Lei please make sure to file this to Jira. We are aware of some glitches in some of plugins when they are used with other plugins and we want to get this to the bottom of it for sure.  Please detail out as much as you can, and add enhancement request based on some of your exprience of using plugins in general if any.

     

    Thanks guys.

     

    Ryan

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 11, 2010 10:18 AM   in reply to Lei Gu

    Thank you Lei!

     

    Ryan

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 2, 2010 4:16 PM   in reply to Lei Gu

    Hi Lei,

     

    I've just checked in a fix for this into the trunk of the OSMF SVN repository if you'd like to try it out.

     

    Info here if you are not familar with the repository:

    http://opensource.adobe.com/wiki/display/osmf/Get+Source+Code

     

    Thanks,

    - charles

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 11, 2011 5:28 AM   in reply to rshin

    I am Beginner to this field and don't know much.

    I have few questions.

    1>      How i would be able to use authentication dialog box username and password in strobe media playback.

    2>    How i would be able to add logo image to my video running in strobe media playback. I mean where do i need to make changes to strobe media playbacksource code.

    Suggest some good resource for as3.

    Will be waiting for your favorable response.

    Please help me out.

    Thanks and Regards

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points