locked
Bug in security context - client is specific, something is changing it. RRS feed

  • General discussion

  • I new up my entities with the signature:        

    public MyEntities(string connectionString) : base(connectionString, "MyEntities")

            {
                this.ContextOptions.LazyLoadingEnabled = true;
                OnContextCreated();
            }
    This call (connectionstring) has an explicit user and password AND integrated security OFF or false.  I am logged in on the PC as admin (local admin - w/domain account) and have a token (mapped drive) to the db server on which the same login is administrator AND sa.
    I also have a remote connection to db server.  I also am running SSMS from the local server connected to the dbserver.
    I then run my app and make the call for new entities, using signature above (explicit connection string), and guess who sql profiler reports and the log file aduit says is logged on?  "sa",  but then I insulate the dbserver from all these connections the exact same app now connects as designated user.
    It appears something is overriding my explicit request for a named user, without integrated security?
    Friday, November 11, 2011 1:45 PM

All replies

  • Difficult to see what is going on from this narrative, but one possibility is simply that you are looking at the wrong things in Profiler. Which column are you looking at? LoginName or SessionLoginName?

    You mention a log file? What log file is this?

    What do you see when you use for instance sp_who2?


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Saturday, November 12, 2011 7:02 PM