Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/pip/stix_shifter/aioboto3-11.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
delliott90 authored Sep 29, 2023
2 parents 4a4389a + 3db93af commit 105a1cb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion stix_shifter_modules/okta/stix_transmission/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ class APIClient:

def __init__(self, connection, configuration):
auth = configuration.get('auth')
self.headers = {'Authorization': auth['api_token'],
"""
The Okta API requires the custom HTTP authentication scheme SSWS for API token (API key) authentication.
Requests must have a valid API token specified in the HTTP Authorization header with the SSWS scheme.
Ref: https://developer.okta.com/docs/reference/core-okta-api/#api-token-authentication
"""
if 'SSWS' in auth['api_token']: #this check is for backward compatibility
self.api_token = auth['api_token']
else:
self.api_token = 'SSWS '+ auth['api_token']
self.headers = {'Authorization': self.api_token,
'Content-Type': 'application/json', 'Accept': 'application/json'}

self.client = RestApiClientAsync(connection.get('host'), port=None, headers=self.headers)
Expand Down

0 comments on commit 105a1cb

Please sign in to comment.