I believe it's possible to configure Apache to use SQL Server for authentication. You supply the DB connection parameters and a query to run. I suppose the 开发者_运维百科contract is something like:
If the query returns something the user is authenticated, and if the query results are empty, the user is unkown.
Does anyone know how I can configure this?
Apache supports mod_authn_dbd
that supports authentication against a SQL driver, and mod_dbd
to support various database drivers. There are various projects that bridge the Apache DBD Framework with the TDS protocol, thus allowing authentication against a SQL Server, like odbc-dbd.
I'm not aware of anyone doing this in production, but it looks like theoretically is possible, all you have is to do is connect the dots.
Of course, we're talking here a true HTTP authentication scheme: Basic or Digest. If you are interested in 'Forms' authentication, that is not HTTP authentication, that is some application behavior and as such is implemented in your app code, not in Apache.
精彩评论