eclecticiq / OpenTAXII

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

Can't get token from openTAXII server #219

Open fear-the-reaper opened 2 years ago

fear-the-reaper commented 2 years ago

I've been trying to test an openTAXII server to push a bundle been using this as a reference. However whenever I tried getting the jwt token it gives me this image I even tried to do it in the 9000 port but the error persists. I also edited the data-configuration.yml file and Dockerfile. Please help thanks!!

erwin-eiq commented 2 years ago

Thank you for your bugreport. I really appreciate it when people take the time to create an issue when they find bugs.

I'll look at it as soon as possible, however I'm currently quite busy finishing up https://github.com/eclecticiq/OpenTAXII/pull/222. Once that is done, I plan to go through all the open issues and fix them.

fear-the-reaper commented 2 years ago

Sure take your time

erwin-eiq commented 2 years ago

Update: this was caused by https://werkzeug.palletsprojects.com/en/2.1.x/changes/#version-2-1-0. Specifically this bit:

Request.get_json() will raise a 400 BadRequest error if the Content-Type header is not application/json. This makes a very common source of confusion more visible.

We depended on the previous behaviour where it returned None. I'll modify the code to cover both cases.

Thanks again for reporting this!

erwin-eiq commented 2 years ago

Hm... it seems I've drawn my conclusion too quickly. You're already getting a 401. The above issue would have gotten you a 400 instead. Seperate issue apparently :thinking: I'll keep digging.