Re: Can I force a Windows Authentication / Login?



Hi Keith,

One technique is to redirect them to a page that denies access to anonymous
users. This throws up the login dialogue box.

In your Web.config, add a <location> before <system.web>

<configuration>
<location path="auth.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<system.web>
....

Then create a page called auth.aspx.

In your button click code redirect like this:

Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Response.Redirect("auth.aspx")
End Sub

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]




"Keith H" <khinkle@xxxxxxxxxxxxxxxx> wrote in message
news:60E11FC6-D49E-45B7-8EFE-03C25034829F@xxxxxxxxxxxxxxxx
> I'm looking for a way to force the user to re-authenticate with their
> Windows
> username/password/domain after clicking the submit button on an ASP.NET
> page.
> This is for an internal application.
>
> Does anyone know if/how this can be done?


.