According to the ai bot this should work `user_ide...
# flyte-support
b
According to the ai bot this should work
user_identity = context.execution_metadata.security_context.user_identity
I followed the references to some merged PRs. Is this still not released or is there a way to get the authenticated user in a workflow or task?
t
I don’t think flyte exposes this information to tasks today.
the field you’re looking for presumably is this I think
this is set by the control plane in the request spec, and I believe this is handed down to the CRD that flyte propeller reads
but from there I don’t think it’s passed down to the plugins (and hence to the tasks)
@high-accountant-32689 correct me if i’m wrong
b
The ability to know who ran a task would be important for tracing and audit
t
the information is stored in the control plane database.
b
so technically I can get it if I query the db
t
but you’re asking to make it accessible from within a task while it’s running right?
yes
though you will have to match up the principal field against your idp most likely.
in our db it’s a random id that the idp assigns
b
I generate a report at the end of a workflow, a snap shot of the workflow. I would like to list who ran the execution. In the UI I am able to filter all my executions
I see. It seems like this would be a feature request then
t
filter == me is easier though.
that just takes the current identity and uses it as a filter
but yeah i would check the db first
👍 1
see what information is there.
b
will do. Thank you
@thankful-minister-83577 I could not find user metadata in either the metadata bucket or the database. In the cause of the user column of the execution table the value user is always postgres I tried to find principal in the tables but could not Eventually it will be important to know who ran a pipeline for audit purposes
t
that’s super weird. who is your idp again?
b
okta
t
and the /me endpoint in the UI shows the correct information?
b
yes
t
wait
what’s your sql query?
you’re not
select user from …
right?
that doesn’t work
you need
select "user" from …
b
which table would I find user
t
executions
b
what about principal
or are they the same
t
same
bad naming