how can i run app under specific windows credentials

Posted on 2014-08-25
Last Modified: 2014-08-26

I have application which set to authentication as "windows"(integrated) in web.config. I want to give source code to user whose machine is not part of domain. however, there is domain account created for him. How can i make application run under that account under integrated authentication? Can i hard code it somewhere?

Question by:KashyapVachhani
    1 Comment
    LVL 28

    Accepted Solution

    If your ASP.NET app is using integrated authentication, then it uses the credentials of the app pool that the IIS application is configured to use. If you're running the code from Visual Studio, the app will run as the user who executes it. If you've given the source code to another user who isn't on the domain and they execute it, it will attempt to use their account to execute the code and connect to your domain resources. Since they're not on the domain, their credentials will translate to "Anonymous logon" or "Guest"-type credentials, which likely don't have any rights.

    Another option you might have, though, is a handy switch with the RUNAS tool - running it with "/netonly" like this:

    RUNAS /netonly /user:ServerDomain\ServerAppUser devenv.exe

    Most people don't know about that switch - it does two important things:

    1. It launches the process as the currently logged-in user. This allows the app to run normally on the local machine.
    2. When the app attempts to access a remote resource, it passes the credentials provided on the command line. In this way, a local process can be set to access other devices as a user of a domain of which they're not even a member.

    I use this all the time when I launch SQL Management Studio because we have a few servers on a different domain - using this switch, I can log into those servers using integrated authentication even though they're on a different domain.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Introduction (All good things must come to an end ( The original MySQL API ( has gone away, deprecated by PHP in Version 5.5, and removed from PHP in all curre…
    A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now