Skip to content

Authentication

QuantConnect.Api.Authentication

Bases: Object

Helper methods for api authentication and interaction

hash

hash(timestamp: int) -> str
hash(timestamp: int, token: str) -> str

Generate a secure hash for the authorization headers.

Returns:

Type Description
str

Time based hash of user token and timestamp.

link(
    endpoint: str,
    payload: List[KeyValuePair[str, Object]] = None,
) -> str

Create an authenticated link for the target endpoint using the optional given payload

Parameters:

Name Type Description Default
endpoint str

The endpoint

required
payload List[KeyValuePair[str, Object]]

The payload

None

Returns:

Type Description
str

The authenticated link to trigger the request.

populate_query_string

populate_query_string(
    query_string: NameValueCollection,
    payload: List[KeyValuePair[str, Object]] = None,
) -> None

Helper method to populate a query string with the given payload