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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...