Impersonation in code/Sharepoint

S

Seth Williams

I've got a Sharepoint website for which the 'big guy' doesn't want to enable
impersonation.

But - I need impersonation for a file list (from another server), so I set
out to do it in code - - I found this on Support.MS.com:
http://support.microsoft.com/?id=306158#XSLTH3167121123120121120120

I use the short portion, to impersonate the Authenticating User in Code.
This works for our regular dev web server, but apparently not in a
Sharepoint website (pointing to it in a Page View Web part)

Is there a way to create code to, instead of using the authenticated user,
use the ASPNet user account?
 
S

Stan

I've got a Sharepoint website for which the 'big guy' doesn't want to enable
impersonation.
...
Is there a way to create code to, instead of using the authenticated user,
use the ASPNet user account?

If impersonation is disabled then the ASP.NET user account will be
used anyway. However if the authentication mode is "Windows" then in
theory the authenticated Users privileges are merged with the ASP.NET
account (or so Microsoft tell us).

HTH
 
S

Seth Williams

My code is below - anyway to change it to the ASPNet user?

Dim impersonationContext As
System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
currentWindowsIdentity = CType(User.Identity,
System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()

I've tried substituting it, in place of User.Identity, but that's not meant
for a string, so, of course, it doesn't work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Impersonation 6
Sharepoint ECM Allows Organizations To Easily Control 0
access sharepoint list 2
Impersonation 4
Impersonation 0
Impersonation 1
TS6134:Direct Client:- Sharepoint Admin 0
SharePoint help 8

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top