Preventing the Windows Logon Dialog box for Logons 
Author Message
 Preventing the Windows Logon Dialog box for Logons

I am writting a front-end for SharePoint Portal Server that combines an SQL
server and Active Directory for user logons.  That part is working fine.

What I would like to avoid, is the Windows Logon Dialog box that pops up
when users attempt to navigate outside of the "public" portion and into SPS
where the files are secured by UserID/Group.

I tried the following:

        Dim iToken As Integer
        Dim iError As Integer

        Dim loggedOn As Boolean = LogonUser(txtUserID.Text, txtDomain.Text,
txtPassword.Text, 3, 0, iToken)
        If Not loggedOn Then
            iError =
System.Runtime.InteropServices.Marshal.GetLastWin32Error()
            If iError <> 0 Then
                lblMessage.Visible
                lblMessage.Text = "Logon error. Error: " & iError.ToString()
            End If
        Else
            ' Logged on
            Dim iTokenCopy As IntPtr = New IntPtr(iToken)

            Dim mWI2 As WindowsIdentity = New WindowsIdentity(iTokenCopy)

            'Impersonate the user.
            Dim mWIC As WindowsImpersonationContext = mWI2.Impersonate()

            ' We should now be impersonating...
            Response.Redirect("wfrmTestImp.aspx")
        End If

And while it works in the current page, as soon as the next page loads, I'm
back as the ASPNET user...I'm sure I am missing something...can someone
point me in the right direction for how to log on the user using a "Form"
instead of the dialog, such that when the secured pages are hit the user is
already logged on?

I know I could "impersonate" at every page, but with SPS, that will be
difficult since *it* handles page loads and rendering, so it really needs to
be that I actually *change* the context the user is running in, *as if* they
had logged in using the "popup Windows Logon Dialog box".  (I would also
like to be able to "log them off" when the Session expires for security
purposes).

Thank you,

--
Andrew D. Fields



Thu, 18 Nov 2004 22:58:46 GMT  
 Preventing the Windows Logon Dialog box for Logons
Is this something no one has ever done before?

I know I have read about changing user context such that all subsequent page
requests occur as that user but can't find where I read it.

However, if I am incorrect, and the following can't be done, just let me
know and I'll try to figure out another way.

Thanks in advance.

--
Andrew D. Fields


Quote:
> I am writting a front-end for SharePoint Portal Server that combines an
SQL
> server and Active Directory for user logons.  That part is working fine.

> What I would like to avoid, is the Windows Logon Dialog box that pops up
> when users attempt to navigate outside of the "public" portion and into
SPS
> where the files are secured by UserID/Group.

> I tried the following:

>         Dim iToken As Integer
>         Dim iError As Integer

>         Dim loggedOn As Boolean = LogonUser(txtUserID.Text,
txtDomain.Text,
> txtPassword.Text, 3, 0, iToken)
>         If Not loggedOn Then
>             iError =
> System.Runtime.InteropServices.Marshal.GetLastWin32Error()
>             If iError <> 0 Then
>                 lblMessage.Visible
>                 lblMessage.Text = "Logon error. Error: " &
iError.ToString()
>             End If
>         Else
>             ' Logged on
>             Dim iTokenCopy As IntPtr = New IntPtr(iToken)

>             Dim mWI2 As WindowsIdentity = New WindowsIdentity(iTokenCopy)

>             'Impersonate the user.
>             Dim mWIC As WindowsImpersonationContext = mWI2.Impersonate()

>             ' We should now be impersonating...
>             Response.Redirect("wfrmTestImp.aspx")
>         End If

> And while it works in the current page, as soon as the next page loads,
I'm
> back as the ASPNET user...I'm sure I am missing something...can someone
> point me in the right direction for how to log on the user using a "Form"
> instead of the dialog, such that when the secured pages are hit the user
is
> already logged on?

> I know I could "impersonate" at every page, but with SPS, that will be
> difficult since *it* handles page loads and rendering, so it really needs
to
> be that I actually *change* the context the user is running in, *as if*
they
> had logged in using the "popup Windows Logon Dialog box".  (I would also
> like to be able to "log them off" when the Session expires for security
> purposes).

> Thank you,

> --
> Andrew D. Fields




Sat, 20 Nov 2004 23:17:19 GMT  
 Preventing the Windows Logon Dialog box for Logons
Hey Andrew,

I know it can be done becuase bCentral hosting of SharePoint does it
somehow. I am trying to do something similar but using the form to
authenticate and login the user for Outlook Web Access (Exchange 2000).

We can use the pop-up box for now, but would like to get away from that.

Josh

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Tue, 23 Nov 2004 22:28:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Change the Windows Logon Dialog box ?????

2. Change the Windows Logon Dialog box ?????

3. Change the Windows Logon Dialog box ?????

4. Change the Windows Logon Dialog box ?????

5. Logon Scripts in VB for NT logons

6. How to activate the RAS network-logon dialog under WINDOWS NT

7. How to pass logon dialog box silently

8. Logon Oracle server with dialog box

9. Replacing NT's Logon Dialog Box

10. HELP: How to open an NT Logon Dialog Box

11. Urgent: displaying nt logon dialog box

12. Preventing Outlook Dialog Boxes

 

 
Powered by phpBB® Forum Software