# User for system task

**URL:** <https://forum.flowable.org/t/user-for-system-task/6380>\
**Category:** Flowable Engine\
**Created:** [July 14, 2020, 10:58am UTC](https://forum.flowable.org/t/user-for-system-task/6380 "2020-07-14T10:58:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pahujadeepanshu](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/pahujadeepanshu/32/837_2.png) [@pahujadeepanshu](https://forum.flowable.org/u/pahujadeepanshu)\
**Post date:** [July 14, 2020, 10:58am UTC](https://forum.flowable.org/t/user-for-system-task/6380/1 "2020-07-14T10:58:50Z")

</div>

Hi,

Hope all the readers are doing fine in current scenarios. I have a question around system tasks in Flowable. Under which user the system tasks run.

I have changed the Authentication filter to pass all calls to flowable without any authorization and I save the Bearer token there and then. The problem I have is if I want to make any call to our external authorization system as a service task I have now way to derive this token. Is there a way I can do the same?

Thanks,  
Deepanshu

---

<div class="post-metadata">

**Author:** ![pahujadeepanshu](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/pahujadeepanshu/32/837_2.png) [@pahujadeepanshu](https://forum.flowable.org/u/pahujadeepanshu)\
**Post date:** [July 14, 2020, 5:06pm UTC](https://forum.flowable.org/t/user-for-system-task/6380/2 "2020-07-14T17:06:52Z")

</div>

Hi @tijs @filiphr ,

Can you guys help here please?

Thanks !!

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [July 22, 2020, 6:43am UTC](https://forum.flowable.org/t/user-for-system-task/6380/3 "2020-07-22T06:43:17Z")

</div>

Hey @pahujadeepanshu,

I am not quite following what you need to do.

If you are using Spring then you can get a hold of the current Security Context and extract all the information that you need from there in your service task implementation.

Keep in mind that if you are using async service tasks there is no authentication context and you’ll need to save the token as part of your process in a step before the async service task.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![pahujadeepanshu](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/pahujadeepanshu/32/837_2.png) [@pahujadeepanshu](https://forum.flowable.org/u/pahujadeepanshu)\
**Post date:** [September 9, 2020, 8:59pm UTC](https://forum.flowable.org/t/user-for-system-task/6380/4 "2020-09-09T20:59:20Z")

</div>

So this essentially means if a process can form async tasks then there is no logging who did those tasks. At max, it can preserve the initiator if I am correct and if not, probably a variable can do that.

But lets say, I have some async tasks that run one after another and my flowable instance is part of a bigger system actually talking to a third party authentication system, then for flowable it may seem OK but my calls to other services in the bigger ecosystem need some user token flow.

Any thoughts ?

BR/  
Deepanshu

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [September 13, 2020, 8:50pm UTC](https://forum.flowable.org/t/user-for-system-task/6380/5 "2020-09-13T20:50:50Z")

</div>

> [@pahujadeepanshu](#):
>
> But lets say, I have some async tasks that run one after another and my flowable instance is part of a bigger system actually talking to a third party authentication system, then for flowable it may seem OK but my calls to other services in the bigger ecosystem need some user token flow.

Yes. Flowable doesn’t care here, the user id is data which might come from another place, as you say.

---

<div class="post-metadata">

**Author:** ![pahujadeepanshu](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/pahujadeepanshu/32/837_2.png) [@pahujadeepanshu](https://forum.flowable.org/u/pahujadeepanshu)\
**Post date:** [September 17, 2020, 2:09pm UTC](https://forum.flowable.org/t/user-for-system-task/6380/6 "2020-09-17T14:09:39Z")

</div>

Ok, so do you think it makes sense to have something there wherein these days its easy to assume flowable could be one of the microservices with a third party authentication.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [September 22, 2020, 9:55pm UTC](https://forum.flowable.org/t/user-for-system-task/6380/7 "2020-09-22T21:55:40Z")

</div>

Yes, in fact that’s often how it’s deployed. E.g. using Spring Boot + custom security configuration.
