WindmillWWindmill
Powered by
marmoM
Windmill•16mo ago•
16 replies
marmo

passing jwt secrets between django app and windmill via api

Hey all, i am trying to securely pass bearer tokens between my django app and windmill to authenticate API calls and create a hashed payload for data exchange. In my django app i am using python-jwt (import jwt). This doesnt seem to be compatible within windmill. Since jwt doesnt seem to be supported in Windmill, I tried creating a custom encode_jwt function in Windmill using hmac, hashlib, and base64 to match Django’s HS256 encoded JWTs. Despite this, the tokens still aren’t matching up as expected.

I know in the documentation there are specifics that need to be passed from the windmill side in the payload, I do have those listed as part of the payload referencing this doc. Is there a better way to do this? I can do it in params if needed...

After narrowing down, I think this might have to do with my middlware and how it's authorizing the call back from windmill to my django app. Maybe something to do with listing the user in windmill to then be authenticated as it comes into django. This would mean potentially setting up a windmill user model in my django database in order to be authenticated properly, i believe. I just cannot seem to bypass the "unauthorized header" piece that is set in my windmill script. Wondering if i'm just going about this incorrectly.
Screenshot_2024-11-04_at_8.10.02_AM.png
Screenshot_2024-11-04_at_8.15.33_AM.png
Screenshot_2024-11-04_at_8.15.55_AM.png
Screenshot_2024-11-04_at_8.16.58_AM.png
Screenshot_2024-11-04_at_8.17.08_AM.png
Screenshot_2024-11-04_at_8.26.15_AM.png
WindmillJoin
3,362Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

See Windmill script dependents via API
cmptrCcmptr / help
10mo ago
Windmill Rest API,
ESiteHosterEESiteHoster / help
3y ago
401 Unauthorized Webhook between TwentyCRM and Windmill
AntPruveAAntPruve / help
13mo ago
windmill app -> next.js app
alexBroAalexBro / help
2y ago