Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service.connect method is not compatible for token based authentication #224

Open
zopahima opened this issue Mar 19, 2024 · 1 comment
Open

Comments

@zopahima
Copy link

The connect method checking if the passed argument contains key “username”, if yes – login() method is called, for splunkCloud– there’s no need for a username (only token) so the login is not performed. A service is returned without trying to actually login to the cloud instance.

image

@nhalstead
Copy link

nhalstead commented Dec 9, 2024

import com.splunk.Args;
import com.splunk.Service;

Args config = new Args();
config.put("token", "Bearer " + this.settings.getToken());

return Service.connect(config);

or use the ServiceArgs class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants