Results 1 to 2 of 2

Thread: Serve static resources from Apache HTTPD but authorize with Spring Security?

  1. #1
    Join Date
    Mar 2010
    Posts
    6

    Default Serve static resources from Apache HTTPD but authorize with Spring Security?

    I'm building (for my own education, partially reinventing the wheel), a photo album site, using Spring. The architecture calls for multiple users who will have access to only some albums, and possibly only some photos within albums.

    In a naive implementation I would have Tomcat on port 80 and have Spring Security filter every request, including requests for the image files, which are static filesystem resources.

    My actual deployment will have an Apache front-end, and I'd like to somehow be able to make Apache use the authentication that is being handled by Spring Security. That is, the user will initially login and be authenticated by Spring Security, but when a request comes in for an image file I want it served by Apache, but only if the user has the appropriate Spring Security role.

    Is this possible? Do I need to set up, say, an OAuth provider and have both Apache and Spring Security defer to it? Or is there a better/simpler method?

  2. #2
    Join Date
    Dec 2008
    Location
    New York City
    Posts
    134

    Default

    Quote Originally Posted by jgarrison View Post

    My actual deployment will have an Apache front-end, and I'd like to somehow be able to make Apache use the authentication that is being handled by Spring Security. That is, the user will initially login and be authenticated by Spring Security, but when a request comes in for an image file I want it served by Apache, but only if the user has the appropriate Spring Security role.

    Is this possible?
    Typically httpd is used in front of your servlet container. Meaning a request is processed by httpd before it hits the servlet container. If that's the case for your deployment, the answer to your question is no.

    You could put your servlet container in front of httpd - but then I'm not sure you aren't gaining much if anything by using httpd at all.
    Andrew Thompson - Linked In

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •