Re: Web Part development pops up a logon screen and gives no acces

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I get exactly the same thing as mr. walker. my webpart runs ok in my
account (and other developers acct). but when normal users run it, it popup
a log on screen. I think there is nothing to do with the code, as I already
commented out all the code and recompile, users still get the prompt. I
already deployed it to the GAC and tried to put it in inetpub\iportal\bin,
etc. i also tried to grant permission to related folders...still no luck.
Did you fix it and any idea?


"jgullickson" <jgullickson@xxxxxxxxxxxxxxxxxxxxxxxxx> ¼¶¼g©ó¶l¥ó·s»D:4B15E323-4881-43E4-B802-EF3AE427B7D7@xxxxxxxxxxxxxxxx
> Erik, I'm working on a simular problem and I think there is more involved
> than just impersonation.
>
> I have a web part that will transform the anonymous user into an
> authenticated user based on an external authentication mechanism. The
> idea
> is that the user arrives at the site as an anonymous user, we validate
> them
> and then use impersonation to "switch" them to a regular sharepoint
> account.
>
> Here's the problem: the impersonation happens properly, and we can verify
> this by looking at the "WindowsIdentity.GetCurrent().Name", however when
> we
> examine "Context.User.Identity.Name", it returns the original user.
>
> For example, if I login as "Jason", and the impersonation tries to turn me
> into "John", WindowsIdentity.GetCurrent().Name returns "John", but
> Context.User.Identity.Name still returns "Jason". Since SharePoint still
> thinks I'm "Jason", I can't get at the resources that are assigned to
> "John".
>
> I've read a few different articles that say SharePoint only examines the
> HTTP context when you first hit the site, and that's why it doesn't change
> when I perform the impersonation, but there must be some way to tell
> SharePoint to update this (otherwise how would the "Login" button work,
> switching you from anonymous to an authenticated user?).
>
> I have seen some examples that have you create a second AppDomain, while
> running in the context of the impersonated user, but it seems like alot of
> trouble for something that should be simple...
>
> Any thoughts are appreciated!
>
> "Erik Jensen" wrote:
>
>> I would probably implement impersonation and impersonate a sharepoint
>> admin
>> account for this kind of thing.
>>
>> there are many good articles out there. basically you create a new
>> WindowsIdentity using stored (and secured ;) credentials.. do some
>> operations, then .Undo the .Impersonate used to programatically up the
>> permissions of the request being done.
>>
>> I'd google on sharepoint impersonation. and in particular the string
>> "IsUserInRole"
>>
>> you'll get good articles.
>>
>> "mr.walker" wrote:
>>
>> > I am developing a webpart rendering data from the rootweb and down.
>> > When I am
>> > working on the development server (Virtual Server Win2k3 and SPS2k3Sp1)
>> > adding the web part it works like a clock.
>> > Trying to test it on a colleagues account, he gets a log on screen and
>> > then
>> > access denied.
>> > He has been added to the site - no good
>> > He has been added to the root site - no good
>> > He is now administrator on the SPS - still no good
>> >
>> > How come it works for me (also admin on the server) but not for anyone
>> > else?


.



Relevant Pages

  • Re: SetPassword access denied
    ... safely invoke SetPassword etc..... ... impersonation or using the process token without impersonation) is NOT ... account that is used for performing remote activities in the directory. ... Co-author of "The .NET Developer's Guide to Directory Services ...
    (microsoft.public.windows.server.active_directory)
  • Re: VS.NET 2005 and the "allowDefinition=MachineToApplication" error
    ... Your description of impersonation is great. ... If you want to use the default configured account, eliminate that entry, or configure it as: ... The easiest way to assign correct permissions to all required directories is to run: ... I re-started IIS and tried to access my ASPX page again -- same ...
    (microsoft.public.dotnet.framework.aspnet)
  • [Full-disclosure] Maybe nothing so shady; depends on the motive.
    ... There may be no impersonation going on. ... attempted use of a disabled account would produce messages about "account foo login fail" ... SecureWorks was still reading email addressed to David Maynor. ...
    (Full-Disclosure)
  • Re: Active Directory authority needed in SharePoint Web Part
    ... I've already changed the impersonation username/password in the ... This didn't entirely allow the AD access and it screwed up SharePoint: ... Do I change the account SharePoint's app pool runs under? ... Instead of a SharePoint Web Part that has to talk to Active Directory, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: SetPassword access denied
    ... That said, I think one thing worth pointing out is that in both cases here, your code is supplying credentials to the DirectoryEntry constructor. ... the identity of the current thread (established either via impersonation or using the process token without impersonation) is NOT the account that is used for performing remote activities in the directory. ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ...
    (microsoft.public.windows.server.active_directory)