HTTP 401 -- Unauthorized - API connection error after some requests


I have an error in authentication in the API, I do some authentications successfully, but then it gives an error HTTP 401 -- Unauthorized.

The problem may be that the connection is not closed, but I don't know how I could do it and if this is really the cause of the error.

private void authentication() {

serviceSplunk = new Service(configMap.getSplunkHost(), configMap.getSplunkPort());
String credentials = configMap.getSplunkUserName() + ":" + configMap.getSplunkPassword();
String basicAuthHeader = Base64.encode(credentials.getBytes());
serviceSplunk.setToken("Basic " + basicAuthHeader);


Help me, please!

Labels (4)
0 Karma