By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,874 Members | 1,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,874 IT Pros & Developers. It's quick & easy.

Setting timeout for basic authentication

P: n/a
I have an intranet application that I setup using windows
authentication through IIS basic authentication. Is there
a way to set a timeout, so that after ten minutes the user
will be prompted again to enter their login ID and
password? I have not been able to find anything on
microsoft or google. Other than this, the only way a user
will be prompted again is if they are forced to open a new
browser window for getting to the web page. Thanks
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Joseph,

I don't know if there is a way to do this. It's more a matter of the
browser storing the credentials, and then sending them with each request.
There ^might^ be a header that you can use to cancel this behavior, but I
wouldn't think one exists.

To be sure, I would look somewhere in the HTTP specification for a
header that might change this, other than that, my guess is that there is
little you can do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joseph" <an*******@discussions.microsoft.com> wrote in message
news:9b****************************@phx.gbl...
I have an intranet application that I setup using windows
authentication through IIS basic authentication. Is there
a way to set a timeout, so that after ten minutes the user
will be prompted again to enter their login ID and
password? I have not been able to find anything on
microsoft or google. Other than this, the only way a user
will be prompted again is if they are forced to open a new
browser window for getting to the web page. Thanks

Nov 16 '05 #2

P: n/a
Joe
Thanks for the response.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Joseph,

I don't know if there is a way to do this. It's more a matter of the
browser storing the credentials, and then sending them with each request.
There ^might^ be a header that you can use to cancel this behavior, but I
wouldn't think one exists.

To be sure, I would look somewhere in the HTTP specification for a
header that might change this, other than that, my guess is that there is
little you can do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joseph" <an*******@discussions.microsoft.com> wrote in message
news:9b****************************@phx.gbl...
I have an intranet application that I setup using windows
authentication through IIS basic authentication. Is there
a way to set a timeout, so that after ten minutes the user
will be prompted again to enter their login ID and
password? I have not been able to find anything on
microsoft or google. Other than this, the only way a user
will be prompted again is if they are forced to open a new
browser window for getting to the web page. Thanks


Nov 16 '05 #3

P: n/a
Joe
This is what I found by searching through the host header and such
documentation on w3

15.6 Authentication Credentials and Idle Clients
Existing HTTP clients and user agents typically retain authentication
information indefinitely. HTTP/1.1. does not provide a method for a server to
direct clients to discard these cached credentials. This is a significant
defect that requires further extensions to HTTP. Circumstances under which
credential caching can interfere with the application's security model
include but are not limited to:

- Clients which have been idle for an extended period following
which the server might wish to cause the client to reprompt the
user for credentials.
- Applications which include a session termination indication
(such as a `logout' or `commit' button on a page) after which
the server side of the application `knows' that there is no
further reason for the client to retain the credentials.
This is currently under separate study. There are a number of work- arounds
to parts of this problem, and we encourage the use of password protection in
screen savers, idle time-outs, and other methods which mitigate the security
problems inherent in this problem. In particular, user agents which cache
credentials are encouraged to provide a readily accessible mechanism for
discarding cached credentials under user control.

http://www.w3.org/Protocols/rfc2616/...5.html#sec15.6

"Nicholas Paldino [.NET/C# MVP]" wrote:
Joseph,

I don't know if there is a way to do this. It's more a matter of the
browser storing the credentials, and then sending them with each request.
There ^might^ be a header that you can use to cancel this behavior, but I
wouldn't think one exists.

To be sure, I would look somewhere in the HTTP specification for a
header that might change this, other than that, my guess is that there is
little you can do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joseph" <an*******@discussions.microsoft.com> wrote in message
news:9b****************************@phx.gbl...
I have an intranet application that I setup using windows
authentication through IIS basic authentication. Is there
a way to set a timeout, so that after ten minutes the user
will be prompted again to enter their login ID and
password? I have not been able to find anything on
microsoft or google. Other than this, the only way a user
will be prompted again is if they are forced to open a new
browser window for getting to the web page. Thanks


Nov 16 '05 #4

P: n/a
Hi Joseph

This is untested, but worth a go.

With Basic authentication, two headers are important - when a protected
resource is initially requested, there is a www-authenticate header sent from
the server to the client, one for each authentication type, in order of
preference in a 403 access denied HTTP response. The client, once it has
identified a suitable authentication mechanism, resubmits the HTTP request
with an authorization header containing the credentials: in the case of Basic
authentication it's just Base64 encoded username:password. The authorization
header never times out - hence the problem that you are seeing...

I think (but I'm not sure!) that if you were to write a cookie from the
server to the client with the last access time, then check that cookie when
the request comes back to see if your timeout period has elapsed, then you
can send an HTTP 403 response together with the www-authenticate headers
again, this will force the browser to redisplay a login dialog.

It may work!! But you've some work to do.

Nigel Armstrong

"Joseph" wrote:
I have an intranet application that I setup using windows
authentication through IIS basic authentication. Is there
a way to set a timeout, so that after ten minutes the user
will be prompted again to enter their login ID and
password? I have not been able to find anything on
microsoft or google. Other than this, the only way a user
will be prompted again is if they are forced to open a new
browser window for getting to the web page. Thanks

Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.