WordPress.org

Ready to get started?Download WordPress

Forums

Audio Player
trouble with S3 signed URLs in standalone player (2 posts)

  1. dandante
    Member
    Posted 3 years ago #

    Hi, I tried to post earlier, but the link to my post did not go to my post!
    Anyway, now I have a more precise question.

    I am able to use the standalone player to play publicly accessible MP3 files in one of my S3 buckets, for example:
    https://music19671025.s3.amazonaws.com/test.mp3

    But most of my MP3 files are not publicly accessible. They can be played by anyone who has a signed url, and indeed I can use these signed URLs to download them or play them in my browser's default mp3 player, but when I try and play them in the standalone flash player, it tells me "File not found" and in my javascript console in Chrome I see:
    Failed to load resource: the server responded with a status of 403 (Forbidden) (test2.mp3)

    An example of a signed URL is the following:
    https://s3.amazonaws.com/music19671025/test2.mp3?AWSAccessKeyId=MY_ACCESS_KEY&Expires=1286136747&Signature=AJ/wlTcWfxk92zmRIdCpU/DBRpY%3D&x-amz-security-token=%7BUserToken%7DAAcHVXNlclRrboEHt91PHKyBBITNuACP3lcKapM5tDX0MO0KZZBIvO41KhD9Jewqt495o3dJRKom7tqIa1Et7C8ckVqSQFCYpmKcUlyJzuMxenm3fE5CD9VWHNAVcBFNI1LvfJ%2BHmnyOE1OFOrzxus0wa4JURNNuNhsCk9NbHm3umgo%2BQo3m//35snEdKQYh4z0tRzRg9j2vnlrk611s2crgxOXwafvlGQx4DouWB1Bn0sp9tkwilSzuDU7kLNQu4URml5XH7OrLk5ZF/D9TwiYqzs9MuPFyrBUgwDQQcOMW/k7/l/jLHRZJ7M92DWfb3OAaf2f2PQDl%2BcEWzGYkEAHuCGbOAoalk9E%3D

    This URL will not work--I've changed it, plus it has expired--but I provide it as an example of what these signed URLS are supposed to look like.

    I think that the standalone player may be changing the URL a bit. Signed URLs have to be used exactly as they are, letter for letter. The signature is a cryptographic hash of certain parts of the URL along with my Amazon Web Services secret key, so if the URL is changed at all, it won't work.

    This could include, for example, changing the representation of a space from + to %20.
    Or any other changes to the encoding of the URL.

    BTW, I do have a crossdomain.xml file (publicly accessible) in my s3 bucket, although the standalone player doesn't seem to care if I have it or not.

    To recap: I *can* play publicly accessible mp3s from my S3 bucket in the standalone player.
    I cannot play a protected mp3 that I have a signed URL for.
    I *can* use this URL to download or play the mp3 in any other player.
    So although I see a "Forbidden" error, I know that permissions are not the issue--I think that the standalone player is somehow changing the URL.

    Is there a way to see exactly what URL it is trying to load? If I install the debug flash player and enable logging, will that do it?

    Thanks in advance,
    Dan

  2. dandante
    Member
    Posted 3 years ago #

    I figured out a workaround to this.

    Basically, I just tell the standalone player to go to some url that I control.
    That URL then does an http redirect to the long complex URL that cannot be changed (which the standalone player was changing deep in its internals).

    Luckily the standalone player can follow redirects and this works just fine.

    Dan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic