eclecticiq / OpenTAXII

TAXII server implementation in Python from EclecticIQ
BSD 3-Clause "New" or "Revised" License
185 stars 88 forks source link

add support for token auth type used by taxii2client #255

Open benjwebster opened 1 year ago

benjwebster commented 1 year ago

taxii2client supports authentication with a token header by default.

This change adds it as a valid token type to forward to upstream authentication implementations.

from taxii2client.v21 import Server
from taxii2client.common import TokenAuth

api_key = "1234567890"
token_auth = TokenAuth(api_key)
server = Server('https://demo.eclecticiq.com/taxii2/', auth=token_auth)

Example Headers:

Cf-Visitor: {"scheme":"https"}
User-Agent: taxii2-client/2.3.0
Accept: application/taxii+json;version=2.1
Authorization: Token 12345678936f70aea7c1dc7bc4f6f6cf1bedde77f2aea969fdb50cd123456789
Cdn-Loop: cloudflare