Login
The search API authenticates on initialisation of the SearchAPI object and provides a variety of options for authentication:
Username and password
SMAL
API Key (with future release post-Jalapeno)
SearchAPI.__init__(host: str, https: bool = True, verify: bool = True, persistent_user: str = None, username: str = None, api_key: str = None, track_response_time: bool = True, csrf: bool = True, reset_persistent_password: bool = False, privileged_access=False, saml = False, encoding: str = "utf-8")
host
string
Host URL
https
boolean
If to use the HTTPS protocol, default True
verify
boolean
If to verify HTTPS requests, default True
persistent_user
string
Optionally, a user to store a persistent login for (meaning passwords will only be asked for on the first run)
username
string
A username to be used with API key authentication (with future release post-Jalapeno)
api_key
string
API Key (with future release post-Jalapeno)
track_response_time
boolean
Flag to allow the wrapper to time AIE responses in the background
csrf
boolean
Flag to enable usage of CSRF cookies in authentication, defaults True
reset_persistent_password
boolean
Flag to reset the password of a persistent user, defaults False
privileged_access
boolean
Flag to initialise the wrapper using privileged access mode, defaults to False
saml
boolean
Flag to use SAML authentication, which opens a browser window for the user to sign in, defaults to False (SAML authentication requires the optional packages, selenium and webdriver-manager)
encoding
string
Encoding type to use for decoding generative streams, defaults to “utf-8” – there should be no need to change this value.
Example
search = SearchAPI("localhost", verify=False, https=True, csrf=False)
Last updated