# AuthorizationTokenSupplier queries

**URL:** <https://community.temporal.io/t/authorizationtokensupplier-queries/4531>\
**Category:** Community Support\
**Tags:** auth, security\
**Created:** [April 25, 2022, 4:06am UTC](https://community.temporal.io/t/authorizationtokensupplier-queries/4531 "2022-04-25T04:06:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruchir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/ruchir/32/6141_2.png) [@Ruchir](https://community.temporal.io/u/Ruchir)\
**Post date:** [April 25, 2022, 4:06am UTC](https://community.temporal.io/t/authorizationtokensupplier-queries/4531/1 "2022-04-25T04:06:08Z")

</div>

Hi Experts,

Can a function be passed as a `AuthorizationTokenSupplier` , for eg:

```auto
AuthorizationTokenSupplier tokenSupplier = () -> return restTemplate.get("http-endpoint-which-returns-jwt-tokens");

```

Also, in one scenario, I’ll be getting the token from the caller of workflow, is it possible to provide that token in the above supplier?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [April 25, 2022, 3:20pm UTC](https://community.temporal.io/t/authorizationtokensupplier-queries/4531/3 "2022-04-25T15:20:22Z")

</div>

You can define your custom `AuthorizationTokenSupplier`, for example:

`public class MyAuthorizationTokenSupplier implements AuthorizationTokenSupplier { ... }`

and pass it to `AuthorizationGrpcMetadataProvider` that you register with WorkflowServiceStubsOptions.

> I’ll be getting the token from the caller of workflow

Not sure what this means but in your custom AuthorizationTokenSupplier you could provide means for the token to be set/updated by the information you get from the caller.  
Hope this helps.
