Security

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

isa_melo
Observer

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() {

Service.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1);
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
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...