diff --git a/README.md b/README.md index 400493d..d91cd7f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ from soarsdk.client import PhantomClient phantom: PhantomClient = PhantomClient(username='username', password='password') # Token Authentication -phantom: PhantomClient = PhantomClient(token='token_string') +phantom: PhantomClient = PhantomClient(splunkToken='token_string') ~~~ diff --git a/pyproject.toml b/pyproject.toml index deed8b1..665fb6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["wheel", 'setuptools==64.0.0'] +requires = ["wheel", 'setuptools'] [project] name = "soarsdk" version = "1.0.1" diff --git a/src/soarsdk/client.py b/src/soarsdk/client.py index f0545ce..f4f9392 100644 --- a/src/soarsdk/client.py +++ b/src/soarsdk/client.py @@ -108,11 +108,11 @@ def connect( splunkToken (str): Splunk SOAR generated token """ if kwargs.get("username") and kwargs.get("password"): - self.session = self.password_authenticate( + self.password_authenticate( kwargs["username"], kwargs["password"] ) if kwargs.get("splunkToken"): - self.session = self.token_authenticate(kwargs["splunkToken"]) + self.token_authenticate(kwargs["splunkToken"]) self.test_authorization() @@ -136,12 +136,8 @@ def password_authenticate(self, username: str, password: str): username (str): username for authentication password (str): password for authentication """ - url: str = self.base_url + "browse" - response: requests.Response = self.session.get( - self.base_url, auth=(username, password), verify=False - ) - response.raise_for_status() - self._set_session_headers() + + self.session.auth = (username, password) self.test_authorization() username = None password = None