views:

371

answers:

2

We're trying to upload a file from a flex client to a JEE app.

  • In a full HTTPS environment
  • JEE server is JBoss 5
  • Using BlazeDS 'Custom' authentication (username and password are entered trhough a flex form)
  • Using BlazeDS per session authentication

In regular AMF calls, we can access user principal and use role mecanism.

However, in our upload servlet, we have no access to user principal.

request.getUserPrincipal() // returns null

How to fix this ?

A: 

A while ago a guy commented on a blog post of mine that https + flex + firefox doesn't work:

have you tried uploading a file in firefox via https? Well, don’t bother, it can’t be done! Adobe blames it on firefox and puts their head in the sand. Read the teeth gnashing and ridiculous claims of Adobe here: http://bugs.adobe.com/jira/browse/FP-201

Ultimately they threw up their hands and said it couldn’t be fixed, and, although said ‘We understand that this is a serious issue and are committed to resolving it’ suggested that either you: 1) Send the file to your server in a different way 2) Find another form of authentication

This may no longer be the case - register and see if the linked bug is still unresolved.

Also - this might not be your exact issue (at least not yet) - I'm just giving pointers.

Bozho
That could have been a clue, but we're using IE...
jruillier
A: 

From your post, and since I haven't used BlazeDS, I can't tell whether you're running into this issue specifically, but it sounds to me like you are --

Take a look at your server logs, or try using a Web debugger like Fiddler (you can tweak it to reveal HTTPS traffic in clear text), and you'll see that Flash blocks custom HTTP auth headers with FileReference.upload(). Why it does, I've no idea, but there's no workaround I know of, other than crafting something or your own manually.

Christian Nunciato