# Context Propagation sample not working

**URL:** https://community.temporal.io/t/context-propagation-sample-not-working/154
**Category:** Community Support
**Tags:** jwt, auth
**Created:** [July 13, 2020, 1:05am UTC](https://community.temporal.io/t/context-propagation-sample-not-working/154 "2020-07-13T01:05:29Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![moh\_abk](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/moh_abk/32/26_2.png) [@moh\_abk](https://community.temporal.io/u/moh_abk)
#### Post date: [July 13, 2020, 1:05am UTC](https://community.temporal.io/t/context-propagation-sample-not-working/154/1 "2020-07-13T01:05:29Z")

</div>

We use jwt for authentication which means that workflows and activities need to carry around jwt token of the function that triggers them.

I tried adapting the sample to no avail. then tested the sample and it doesn’t work correctly.

logs below;

```
|2020-07-13T02:04:02.202+0100|INFO|internal/internal_worker.go:1029|Started Worker|{"Namespace": "default", "TaskQueue": "ctx-propagation", "WorkerID": "82087@moh-abks-mbp.lan@"}|
|---|---|---|---|---|
|2020-07-13T02:04:11.615+0100|DEBUG|internal/internal_event_handlers.go:478|ExecuteActivity|{"Namespace": "default", "TaskQueue": "ctx-propagation", "WorkerID": "82087@moh-abks-mbp.lan@", "WorkflowType": "CtxPropWorkflow", "WorkflowID": "ctx-propagation_fdcb90bf-a3db-4a5f-9262-56aa0e4e9d5b", "RunID": "a675a7cd-6ea9-4a2c-8efd-692290e38c4d", "ActivityID": "5", "ActivityType": "SampleActivity"}|
|2020-07-13T02:04:11.669+0100|INFO|ctxpropagation/workflow.go:29|context propagated to activity|{"Namespace": "default", "TaskQueue": "ctx-propagation", "WorkerID": "82087@moh-abks-mbp.lan@", "WorkflowType": "CtxPropWorkflow", "WorkflowID": "ctx-propagation_fdcb90bf-a3db-4a5f-9262-56aa0e4e9d5b", "RunID": "a675a7cd-6ea9-4a2c-8efd-692290e38c4d", "": ""}|
|2020-07-13T02:04:11.669+0100|INFO|ctxpropagation/workflow.go:30|Workflow completed.|{"Namespace": "default", "TaskQueue": "ctx-propagation", "WorkerID": "82087@moh-abks-mbp.lan@", "WorkflowType": "CtxPropWorkflow", "WorkflowID": "ctx-propagation_fdcb90bf-a3db-4a5f-9262-56aa0e4e9d5b", "RunID": "a675a7cd-6ea9-4a2c-8efd-692290e38c4d"}|
```

---

<div class="post-metadata">

### Author: ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)
#### Post date: [July 13, 2020, 1:37am UTC](https://community.temporal.io/t/context-propagation-sample-not-working/154/2 "2020-07-13T01:37:41Z")

</div>

Thanks a lot for letting us know. Let me take a look to see if the problem is with the sample of the SDK itself.

---

<div class="post-metadata">

### Author: ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)
#### Post date: [July 13, 2020, 1:47am UTC](https://community.temporal.io/t/context-propagation-sample-not-working/154/3 "2020-07-13T01:47:23Z")

</div>

It looks like the sample forgets to configure the context propagator with the client. Make sure that it is included into client.Options:

```auto
c, err := client.NewClient(client.Options{
       HostPort: client.DefaultHostPort,
       ContextPropagators: []workflow.ContextPropagator{ctxpropagation.NewContextPropagator()},
})

```

---

<div class="post-metadata">

### Author: ![ryland](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/ryland/32/11_2.png) [@ryland](https://community.temporal.io/u/ryland)
#### Post date: [July 13, 2020, 1:58am UTC](https://community.temporal.io/t/context-propagation-sample-not-working/154/4 "2020-07-13T01:58:34Z")

</div>

@Cully please track this

---

<div class="post-metadata">

### Author: ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)
#### Post date: [July 13, 2020, 2:04am UTC](https://community.temporal.io/t/context-propagation-sample-not-working/154/5 "2020-07-13T02:04:34Z")

</div>

It looks like context propagation is broken in the TestSuite. Filed [an issue](https://github.com/temporalio/go-sdk/issues/190) to get this fixed.

Here is the fix for the sample itself: [https://github.com/temporalio/go-samples/pull/39](https://github.com/temporalio/go-samples/pull/39)

---

<div class="post-metadata">

### Author: ![moh\_abk](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/moh_abk/32/26_2.png) [@moh\_abk](https://community.temporal.io/u/moh_abk)
#### Post date: [July 13, 2020, 8:54am UTC](https://community.temporal.io/t/context-propagation-sample-not-working/154/6 "2020-07-13T08:54:59Z")

</div>

thanks! that sorted it 😃
