InitializeSecurityContext failed Exception when try to authenticate with Win_Sspi Authentication
Actual Result
- InitializeSecurityContext failed Exception when try to authenticate with Win_Sspi Authentication in PC without register in a Microsoft Active Directory domain:
System.Exception: InitializeSecurityContext failed
at FirebirdSql.Data.Client.Managed.Sspi.SspiHelper.GetClientSecurity(Byte[] serverToken)
at FirebirdSql.Data.Client.Managed.AuthBlock.Start(Byte[] serverData, String acceptPluginName, Boolean isAuthenticated, Byte[] serverKeys)
at FirebirdSql.Data.Client.Managed.GdsConnection.Identify(String database)
at FirebirdSql.Data.Client.ClientFactory.CreateManagedDatabase(ConnectionString options)
at FirebirdSql.Data.Client.ClientFactory.CreateDatabase(ConnectionString options)
at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
at FirebirdSql.Data.FirebirdClient.FbConnection.Open()
Expected Result
- Firebird Exception (code and message) should happen.
Enviroment Setup
- Windows 11 Pro
- FirebirdSql.Data.FirebirdClient Version 10.3.3
AD is not required for SSPI. It works with "local" account as well.
Do you have a repro?
AD is not required for SSPI. It works with "local" account as well.
Do you have a repro?
The issue occurs when trying to access a FirebirdSQL database that is on another computer controlled by a Microsoft Active Directory. When the client computer, which is not controlled by any Active Directory, tries to access this database without providing login credentials, the exception occurs.
Ahh, OK. In that case that is expected. So it's only about the exception type/message, right?
Ahh, OK. In that case that is expected. So it's only about the exception type/message, right?
Right. the issue is that it is not generating a FbException as it should and my software is not able to handle this exception.
For your fix reference here is the fbclient.dll exception error message for the same scenario: