[quoted text, click to view] On Feb 23, 7:58 pm, dareag <dar...@discussions.microsoft.com> wrote:
> I have an ISAPI dll that uses basic authentication, validating users in a
> local database. I want to fist try and authenticate users using windows
> authentication; if this fails, (ie they do not have a windows account), I
> want to use the previous method of authenticating.
>
> How do I do this? Can I try NTLM and then revert to Basic. I tried using
> 'Integrated Windows Authentication', but I couldn't see how to force Basic
> afterwards. I also need the dll to run as the anonymous user, so that the
> user has the correct directory permissions.
Our FOST.3 framework does this. Every user has credentials information
stored in the database. If the user is registered as an Active
Directory/local user then the framework returns its own 401 response
triggering IIS to check the credentials against the users using basic
authentication/NTLM or whatever other authentication protocols are set
up for IIS.
If the user is registered such that the password is in the database
then this password is checked by the framework. For active directory/
local users IIS informs you of the authenticated user in the server
variables.
In both cases a cookie set on the browser session (database users
could have a longer cookie) to tell the framework how the user is
authenticating.
There are a number of details that need to be right to make it secure,
but that's the gist of it.
[quoted text, click to view] >
> I guess the alternative is to let the user determine which account to
> authenticate against. If I did this would it still be anonymouse access?
We also allow anonymous access to the site. If you're going to be
using the normal log in process seen on most web sites then this will
look to IIS like anonymous access and you have to check the user
settings on each page request.
It should also be possible to write an authentication plug-in to IIS,
but it's not something we've really looked at. I suspect it'll be a
lot more complex than the way we've done it.
K