Hi Klaus,

reading your article you make your life harder than it needs. Instead of 
creating an empty component where you override the appendToResponse just change 
your direct action to this:

if (foundVideo.passwordRequired()) {
        String header = request().headerForKey("authorization");
        if (header == null) {
                ERXResponse response = new ERXResponse();
                response.setStatus(ERXHttpStatusCodes.UNAUTHORIZED);
                response.setHeader("Basic realm=\"Videos\"", 
"WWW-Authenticate");
                if (origin != null) {
                        response.setHeader(origin, 
"Access-Control-Allow-Origin");
                }
                return response;
        }
        …

Less code, less files, faster execution :-)

jw


Am 19.09.2012 um 16:30 schrieb Klaus Berkling <kberkl...@dyned.com>:

> 
> On Sep 18, 2012, at 8:33 AM, Patrick Coleman wrote:
> 
>> I have a web site running under WebObjects. I need to password protect some 
>> files but can't figure out how.
>> These files are stored in a mysql database so there is no directory to use 
>> something like .htaccess with.
> 
> This might help:
> 
>       
> http://www.berkling.us/theothersite/page1/files/401_authorization_in_wonder.html
> 
> Basic auth is easy, Digest is harder to implement.  I'll have to look at 
> Pascal's Rest stuff.
> 
> 
> kib
> 
> "Success is not final, failure is not fatal: it is the courage to continue 
> that counts."
> Winston Churchill
> 
> Klaus Berkling
> Web Application Dev. & Systems Analyst
> DynEd International, Inc.
> www.dyned.com



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list      (Webobjects-deploy@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-deploy/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to