Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

How do I control my User account in Postman

$
0
0

I have a .NET Core  WebApi controller method I am able to hit in Postman. However, I receive a SQL Server error when the method goes to talk to the database. It seems I am coming across with my machine account currently. What can I do (either in Postman or my Api Project (.NET Core) ) to be sure it tries to take my Windows user (who I am logged in as currently ) network credentials.  Do I need to put something in the Postman Header or Body ?  Any help or direction would be greatly appreciated. Error is below. The CLE-6DTT222$' is my user account. Any help or direction would be greatly appreciated.

--Jason

 "responseId": "9831ba404180",
    "timeStamp": "2018-08-27T17:00:57.2919062-04:00",
    "httpStatusCode": 500,
    "isOk": false,
    "errors": [
        {
            "messageId": 999,
            "httpStatusCode": 500,
            "messageCode": "CRIT-SYSERR",
            "internal": "Login failed for user 'AMXXXXXXXXX\\CLE-6DTT222$'.",
            "error": {
                "exceptionId": "76721edd-b47c-4160-b178-1f9039603aa3",
                "module": "System.Data.SqlClient.dll",
                "class": "System.Data.SqlClient.SqlInternalConnectionTds",
                "targetSite": "Void .ctor(System.Data.ProviderBase.DbConnectionPoolIdentity, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SqlCredential, System.Object, System.String, System.Security.SecureString, Boolean, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SessionData, Boolean)",
                "props": {
                    "Class": "14",
                    "ClientConnectionId": "5a2db86b-74ce-4318-85b8-9e78331e43a1",
                    "ErrorCode": "-2146232060",
                    "Errors[0]": "System.Data.SqlClient.SqlError: Login failed for user'AMXXXXXXXXX\\CLE-6DTT222$'.",
                    "LineNumber": "65536",
                    "Number": "18456",
                    "Procedure": "",
                    "Server": "DEV-PREMDAT\\LIVEDEBUG",
                    "State": "1"
                },
                "message": "Login failed for user 'AMXXXXXXXXX\\CLE-6DTT222$'.",
                "source": "Core .Net SqlClient Data Provider",
                "stackTrace": "   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling)\r\n   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)\r\n   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)\r\n   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n   at System.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Dapper.SqlMapper.<QueryAsync>d__33`1.MoveNext() in C:\\projects\\dapper\\Dapper\\SqlMapper.Async.cs:line 419\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at WorkersCompensation.Api.Services.Repositories.PremdatRepository.<CancellationDetails>d__2.MoveNext() in C:\\Users\\21843\\Source\\Repos\\WorkersCompensationAPI\\WorkersCompensation.Api.Services\\Data Access Layer\\PremdatRepository.Cancellations.cs:line 53\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at WorkersCompensation.Api.Services.Batch.BatchService.<CancellationDetails>d__14.MoveNext() in C:\\Users\\21843\\Source\\Repos\\WorkersCompensationAPI\\WorkersCompensation.Api.Services\\Batch\\BatchService.cs:line 247",
                "method": "Void .ctor(System.Data.ProviderBase.DbConnectionPoolIdentity, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SqlCredential, System.Object, System.String, System.Security.SecureString, Boolean, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SessionData, Boolean)",
                "data": {
                    "HelpLink.BaseHelpUrl": "http://go.microsoft.com/fwlink",
                    "HelpLink.EvtID": "18456",
                    "HelpLink.EvtSrc": "MSSQLServer",
                    "HelpLink.LinkId": "20476",
                    "HelpLink.ProdName": "Microsoft SQL Server"
                },
                "type": "System.Data.SqlClient.SqlException"
            },
            "isOk": false
        }
    ],
    "maxErrorIndex": 0,
    "_v": "AD"
}


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>