Authentication=DATA_ENCRYPT

Jak podpiąć się do bazy danych po ustawieniu metody autentykacji na “DATA_ENCRYPT”?

Z poziomu .NET należy dodać do ConnectionStringa właściwość Authentication z wartością “DATA_ENCRYPT” czyli ConnectionString powinien wyglądać np tak: “DATABASE=SAMPLE;Authentication=DATA_ENCRYPT”

Więcej o dostępnych właściwościach ConnectionStringa

Z poziomu IBM Data Studio pojawia się błąd.

com.ibm.db2.jcc.am.qo: [jcc][t4][201][11237][4.8.86] Wystąpił błąd autoryzacji połączenia. Przyczyna: mechanizm bezpieczeństwa nie jest obsługiwany. ERRORCODE=-4214, SQLSTATE=28000

I na to jest rada. Wystarczy w oknie właściwości połączenia w zakładce “Optional” dodać wpis “securityMechanism=13″. Dlaczego 13?

Oto krótka ściąga z pomocy

securityMechanism
Specifies the DRDA security mechanism. The data type of this property is int. Possible values are:
CLEAR_TEXT_PASSWORD_SECURITY(3) User ID and password
USER_ONLY_SECURITY (4) User ID only
ENCRYPTED_PASSWORD_SECURITY (7) User ID, encrypted password
ENCRYPTED_USER_AND_PASSWORD_SECURITY (9) Encrypted user ID and password
KERBEROS_SECURITY (11) Kerberos
ENCRYPTED_USER_AND_DATA_SECURITY (12) Encrypted user ID and encrypted security-sensitive data.
ENCRYPTED_USER_PASSWORD_AND_DATA_SECURITY (13) Encrypted user ID and password, and encrypted security-sensitive data.
PLUGIN_SECURITY (15) Plug-in security (DB2 Database for Linux, UNIX, and Windows only).
ENCRYPTED_USER_ONLY_SECURITY (16) Encrypted user ID.

If this property is specified, the specified security mechanism is the only mechanism that is used. If the security mechanism is not supported by the connection, an exception is thrown.
The default value for securityMechanism is CLEAR_TEXT_PASSWORD_SECURITY. If the server does not support CLEAR_TEXT_PASSWORD_SECURITY but supports ENCRYPTED_USER_AND_PASSWORD_SECURITY, the IBM DB2 Driver for JDBC and SQLJ driver updates the security mechanism to ENCRYPTED_USER_AND_PASSWORD_SECURITY and attempts to connect to the server. Any other mismatch in security mechanism support between the requester and the server results in an error.


Comments are closed.