tl_jacob
tl_jacob2w ago

I'm running a Windmill app in an iframe

I'm running a Windmill app in an iframe and using JWT for authentication. The Job logs component renders job output correctly, however the Flow Status UI component isn't working properly. Job updates aren't propagating—the nodes in the flow are completing but the UI isn't updating accordingly. I'm seeing the following error repeatedly in the console:
Bad request: As a non logged in user, you can only see jobs ran by anonymous users
Bad request: As a non logged in user, you can only see jobs ran by anonymous users
I've configured the app to require user login, so I am confident that the JWT auth is working for everything except the flow status UI component. Windmill version: v1.554.0 - also doesn't work on 1.552.1 I've also confirmed this works on v1.500.1 Looks like it has to do with windmill's migration to sse vs polling for job status. At least that's the main difference I can tell between 1.500.1 and 1.552.1 / 1.554.0 Edit: The errors manifest with the Job logs component too if the job runs for > 1 second (wrote a simple script with a sleep(1) to test).
16 Replies
tl_jacob
tl_jacobOP2w ago
No description
tl_jacob
tl_jacobOP2w ago
^ example of job logs view hanging
tl_jacob
tl_jacobOP2w ago
No description
tl_jacob
tl_jacobOP2w ago
^ example of flow status hanging (each node in the flow is a script that sleeps for 1 second and then exits) Hey @rubenf , I'm running into an issue with SSE auth in Windmill when using JWT in an iframe. Flow Status and Job Logs components aren't updating (getting "non logged in user" errors on SSE requests).
rubenf
rubenf2w ago
will take a look
tl_jacob
tl_jacobOP7d ago
I think I've narrowed it down to: SSE requests from an iframed windmill app aren't using the external jwt in the requests Also interesting to note that there doesn't seem to be any auth required on the ?log_offset=0&only_result=true&fast=true' routes, but there is auth required on the log_offset=0&running=true&get_progress=false&fast=true&is_flow=true' routes When I manually set the token cookie in my browser it "resolves" the issue, but this isn't a fix since I want to use the JWT-based auth @rubenf (tagging for visability)
tl_jacob
tl_jacobOP7d ago
GitHub
bug: SSE not using external JWT in iframed app · Issue #6830 · wi...
Describe the bug I am embedding a windmill app in an iframe using external JWT auth. The app has a Flow Status UI component that should display the status of a flow triggered by a button push. Unfo...
rubenf
rubenf6d ago
fixed on latest
tl_jacob
tl_jacobOP6d ago
Thank you ruben!
tl_jacob
tl_jacobOP6d ago
@rubenf heads up that I don't think the issue is fixed on 1.561.0. Still seeing
SSE error: {type: 'error', error: 'Bad request: As a non logged in user, you can only see jobs ran by anonymous users'}
SSE error: {type: 'error', error: 'Bad request: As a non logged in user, you can only see jobs ran by anonymous users'}
No description
rubenf
rubenf5d ago
Ah yes that's a different issue but will fix it tomorrow @tl_jacob can't reproduce what component are you using, what page, require log in, what are the jwt token, where does the job id come from
tl_jacob
tl_jacobOP5d ago
what component are you using
I have a button that triggers a flow and I'm visualizing the flow using the Flow Status UI component.
require log in
Yes the app requires login
what are the jwt token
The jwt token is supplied in the iframe url following https://www.windmill.dev/docs/advanced/external_auth_with_jwt Have you tried deleting your token cookie in your browser?
External auth with JWT | Windmill
Instead of using the built-in authentication and authorization mechanisms, you can generate your own JWT tokens with the desired permissions for your already authenticated users and pass them to Windmill.
rubenf
rubenf5d ago
Can't reproduce @tl_jacob
rubenf
rubenf5d ago
rubenf
rubenf5d ago
also, could you to us your license id please
tl_jacob
tl_jacobOP4d ago
@rubenf did you make sure the token cookie was deleted? DM'd you the license id

Did you find this page helpful?