The scenario is I want to implement single sign on process in my web application, currently I have protected few folders using .htpasswd
Now when a user logs in to the system I want that they should get access to those protected folders as well without being asked for the username and password again by the broswer
Is there a way to achieve this
You wouldn't be able to give users direct access to the files in the protected folders unless all of your users exist in .htpasswd file, and your web application uses the same realm and auth type (basic || digest). Since when using http auth to protect the folders, the username/password is sent on each request.
You could write code that was outside of the protected folders handled the authentication and then used fpassthru
to send the files back though.