top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to integrate Apache's authentication with my app's?

+1 vote
69 views

We have a web app written in PL/SQL (stored procedures in an Oracle database). We use Apache and mod_owa (a variant on the mod_plsql theme) as HTTP glue. Currently were on Apache 2.2, but upgrading to 2.4 would be an option.

Our app handles security itself (our own tables of users and roles); like all web apps, logged in users get a cookie. For the sake of this discussion, lets assume our app runs under www.my.com/app

Now we want to be able to serve some ordinary files using Apache to authenticated users (registration of downloads basically). Again, for the sake of discussion, assume that files are served from www.my.com/file

How can we integrate this with Apaches authentication? Functionally, a user logged in to our app should be able to download a file without logging in again elsewhere. Conversely, someone who isnt logged in trying to download the file should be prompted to log in.

Whats the best way to achieve this? The easiest way?

posted Sep 6, 2013 by Naveena Garg

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Maybe mod_xsendfile or similar? You'll still have the roundtrip into your app.

answer Sep 6, 2013 by Satish Mishra
Thanks.  I wasnt aware of this module, this could work for us. The roundtrip into our app wont be a problem.
Similar Questions
+1 vote

I have application that uses built-in authentication procedure. From client's point of view (browsers, etc.) it works like any basic or digest authentication.
However during the configuration process I sometimes (e.g. when using IIS) have to turn off server's authentication in order to use one built in application. In IIS I simply disable basic and windows authentication for entire site or specific directory and it works perfectly. With other web servers did not have any need to configure anything regarding this, but with Apache I have problem: it prompts for username and password repeatedly even after entering correct credentials. Prompt contains valid realm that is set by my application but entered credentials simply do not pass to my app.
I guess that Apache sort of takes over  the authentication although I did not configure it to do so. I m using default configuration (installed Apache and added my scripting software as script alias). Can anyone help me configure Apache to ignore basic (or digest) authentication sent to my application?

0 votes

I'm trying to setup a forward proxy to access certain endpoints on Remote server which require https with basic authentication in header.

A(Application server) ---> Forward proxy (B) ----> Remote server(C)

i'm at B on which i have setup below Apache Virtual host in which i'm setting the headers to use basic authentication passing encoded value of user & pass configured on remote server.However,i want to include HTTPS in my request to C to ensure the headers are sent securely with encrption to remote server (C). I do Not want to use a separate Virtual host for HTTPS. Should i include a SSL Server certificate in my proxy configuration as given below with the basic authentication in header ?
How can i achieve this in Single virtual host ? I have limited knowledge on apache, so please help here.

I tried searching on the internet but did not find the required solution.

##### vHost 9099 is for basic auth with HTTPS #####
Listen *:9099
<VirtualHost *:9099>

        ServerName      myservername.com
        ServerAlias     myservername.com
        ServerAdmin     iamadmin@myservername.com
        DocumentRoot    /my/doc/root/
        SSLEngine on
        RewriteEngine On
        AllowEncodedSlashes NoDecode

        ProxyRequests On

        # SSL configuration

        SSLCertificateFile       /Path to cert.pem
        SSLCertificateKeyFile    /Path to private key
        SSLCACertificateFile     /Path to CA certs


        ##  Basic64  Encoded XXXX od user and passwd in header

         RequestHeader set Authorization "Basic XXXXX"


         ##  Endpoints accessed via https with basic authentication in header

         ProxyPass /api/api1/   https://30.30.115.22:11111/api/api1/
         ProxyPassReverse /api/api1/    https://30.30.115.22:11111/api/api1/


</VirtualHost>
0 votes

I have the following modules installed on my linux computer:

openldap-2.2.13-12.el4_8.2 
nss_ldap-253-7.el4 

According to the documentation Apache can work with more than one LDAP module:
https://httpd.apache.org/docs/current/mod/mod_authnz_ldap.html [1]

How can I ensure Apache HTTPD server works with OpenLDap installed on my computer? Where I configure it?

+1 vote

I have some doubts about pool of connections with my application developed in PHP. I want optimize the use of resources and database connections has a high computational cost. So the idea is keep a pool of open connections with database.
I'm using Apache webserver, language PHP and PostgreSQL database. In this case the pool of conections must be configured on Apache, PHP or PostgreSQL?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...