graylog-plugin-slack icon indicating copy to clipboard operation
graylog-plugin-slack copied to clipboard

It is not possible to authenticate to the proxy using a username and a password

Open eduault opened this issue 6 years ago • 1 comments

A need to specify username and a password to the the HTTP proxy of my company.

But this plugin don't take into account the username and the password specified in the proxy URI: https://username:password@ip:port

This code should be included in the SlackClient.send(SlackMessage message) method:

Authenticator.setDefault(new Authenticator() {
	@Override
	protected PasswordAuthentication getPasswordAuthentication() {
		return new PasswordAuthentication(httpProxyUsername, httpProxyPassword.toCharArray());
	}
});

The user and password being included in the user-info of the URI. See https://docs.oracle.com/javase/7/docs/api/java/net/URI.html#getUserInfo()

eduault avatar Oct 05 '18 12:10 eduault

a PR that includes this is very welcomed.

jalogisch avatar Oct 05 '18 13:10 jalogisch