use of org.firebirdsql.gds.ng.IAttachProperties in project jaybird by FirebirdSQL.
the class V10ParameterConverter method populateAuthenticationProperties.
@Override
protected void populateAuthenticationProperties(final AbstractConnection connection, final ConnectionParameterBuffer pb) throws SQLException {
IAttachProperties props = connection.getAttachProperties();
ParameterTagMapping tagMapping = pb.getTagMapping();
if (props.getUser() != null) {
pb.addArgument(tagMapping.getUserNameTag(), props.getUser());
}
if (props.getPassword() != null) {
pb.addArgument(tagMapping.getEncryptedPasswordTag(), UnixCrypt.crypt(props.getPassword(), LegacyAuthenticationPlugin.LEGACY_PASSWORD_SALT).substring(2, 13));
}
}
use of org.firebirdsql.gds.ng.IAttachProperties in project jaybird by FirebirdSQL.
the class JnaParameterConverter method populateAuthenticationProperties.
@Override
protected void populateAuthenticationProperties(final AbstractConnection connection, final ConnectionParameterBuffer pb) throws SQLException {
IAttachProperties props = connection.getAttachProperties();
ParameterTagMapping tagMapping = pb.getTagMapping();
if (props.getUser() != null) {
pb.addArgument(tagMapping.getUserNameTag(), props.getUser());
}
if (props.getPassword() != null) {
pb.addArgument(tagMapping.getPasswordTag(), props.getPassword());
}
if (props.getWireCrypt() != WireCrypt.DEFAULT) {
// Need to do this differently when having to add multiple configs
String configString = "WireCrypt = " + props.getWireCrypt();
pb.addArgument(tagMapping.getConfigTag(), configString);
}
}
use of org.firebirdsql.gds.ng.IAttachProperties in project jaybird by FirebirdSQL.
the class V13ParameterConverter method populateAuthenticationProperties.
@Override
protected void populateAuthenticationProperties(final AbstractConnection connection, final ConnectionParameterBuffer pb) throws SQLException {
if (!(connection instanceof WireConnection)) {
throw new IllegalArgumentException("populateAuthenticationProperties should have been called with a WireConnection instance, was " + connection.getClass().getName());
}
IAttachProperties props = connection.getAttachProperties();
ParameterTagMapping tagMapping = pb.getTagMapping();
if (props.getUser() != null) {
pb.addArgument(tagMapping.getUserNameTag(), props.getUser());
}
ClientAuthBlock clientAuthBlock = ((WireConnection) connection).getClientAuthBlock();
if (clientAuthBlock.isAuthComplete()) {
return;
}
clientAuthBlock.authFillParametersBlock(pb);
}
Aggregations