Change User in winforms application during run-time

Discussion in 'ASP .Net' started by landesjoe@yahoo.com, Jul 11, 2006.

  1. Guest

    Hi,
    Here's the problem:
    We have an app that we open by default for the user logged into the
    Windows box on a Windows Domain (using active directory). Let's say
    that's "Hans".
    That works great, the .NET app uses that user's identity in the
    Tread.Prinicipal object all through the system, including logging into
    a SQL2K db where the tables and stored procs use the Windows Account
    for authorization regarding execute permissions.
    Now there are times where we need to log in as another user, i.e. an IS
    person that has much higher permission level. That person's going to be
    "Mike". Besides changing the layout of some navigation forms, we also
    need to update that context change on the Database access tools such
    that the DB now knows that the "NTUserName" is Mike, not Hans anymore.

    I have played around with a bunch of MS suggestions regarding
    "LogonUser" API call. Every time it comes back with error 1314 (generic
    users do not have permission to change User). We can't give our users
    that kind of permission.
    So, is there another way to do this during run-time, or do I need to
    set the principle user before I launch the app to avoid this problem?

    Thanks a lot,
    Joachim Landes
    , Jul 11, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CV
    Replies:
    1
    Views:
    3,799
    Christian Kuendig
    Mar 6, 2004
  2. =?Utf-8?B?Sm9obiBBbGVzc2U=?=

    winforms controls take a long time to load in IE

    =?Utf-8?B?Sm9obiBBbGVzc2U=?=, Feb 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,493
    john Alesse
    Feb 3, 2004
  3. Joe
    Replies:
    1
    Views:
    394
  4. Pierre Yves
    Replies:
    2
    Views:
    481
    Pierre Yves
    Jan 10, 2008
  5. Graham

    Use Membership API in WinForms Application

    Graham, Feb 7, 2006, in forum: ASP .Net Security
    Replies:
    3
    Views:
    320
    Luke Zhang [MSFT]
    Feb 9, 2006
Loading...

Share This Page