M
M
Messi2021-12-09 21:39:59
.NET
Messi, 2021-12-09 21:39:59

Why am I getting cannot authenticate using Kerberos?

When I try to connect to a database (MS SQL) from a project (.NET), I get an error:

Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): 
Cannot authenticate using Kerberos. 
Ensure Kerberos has been initialized on the client with 'kinit' and a Service Principal Name has been registered for the SQL Server to allow Kerberos authentication.
ErrorCode=InternalError, Exception=Interop+NetSecurityNative+GssApiException: GSSAPI operation failed with error -  An unsupported mechanism was requested (unknown mech-code 0 for mech unknown).


{
  "ConnectionStrings": {
    "MyDb": "Server=localhost,1433;Database=MyDb;Integrated Security=False;User Id=UserName;Password=SomePass;",
  },


Docker:
version: '3.1'
services:
    sqldata:
        image: mcr.microsoft.com/mssql/server:2019-latest
        environment:
            - SA_PASSWORD=SomePass
            - ACCEPT_EULA=Y
        ports:
            - "1433:1433"


Can someone please tell me the solution?

ps Connection via jdbc:sqlserver://localhost:1433;database= MyDb - works.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question