Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2008

Tip: Looking for answers? Try searching our database.

Impersonation in code/Sharepoint

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Seth Williams - 20 May 2008 21:02 GMT
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?
Stan - 21 May 2008 00:22 GMT
> 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
Seth Williams - 21 May 2008 15:02 GMT
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

>> I've got a Sharepoint website for which the 'big guy' doesn't want to
>> enable
[quoted text clipped - 10 lines]
>
> HTH

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.