# Create Multiple Secret Tokens

**URL:** <https://discuss.elastic.co/t/create-multiple-secret-tokens/211458>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [December 11, 2019, 11:27am UTC](https://discuss.elastic.co/t/create-multiple-secret-tokens/211458 "2019-12-11T11:27:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Petrie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_petrie/32/59145_2.png) [@Matthew\_Petrie](https://discuss.elastic.co/u/Matthew_Petrie)\
**Post date:** [December 11, 2019, 11:27am UTC](https://discuss.elastic.co/t/create-multiple-secret-tokens/211458/1 "2019-12-11T11:27:51Z")

</div>

Is it possible to create multiple secret tokens for authentication? Ideally we would like a different secret token per service we are using the APM Node.js Agent in

Thanks, Matthew

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [December 11, 2019, 4:57pm UTC](https://discuss.elastic.co/t/create-multiple-secret-tokens/211458/2 "2019-12-11T16:57:51Z")

</div>

Hi @Matthew_Petrie,  
this is not possible, as the APM Server only supports one configured `secret_token`. You might be interested in following along with ongoing efforts to [integrate with Elasticsearch API Keys](https://github.com/elastic/apm-server/issues/2338) for communication between APM Agents and Server.

---

<div class="post-metadata">

**Author:** ![Matthew\_Petrie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_petrie/32/59145_2.png) [@Matthew\_Petrie](https://discuss.elastic.co/u/Matthew_Petrie)\
**Post date:** [December 11, 2019, 5:03pm UTC](https://discuss.elastic.co/t/create-multiple-secret-tokens/211458/3 "2019-12-11T17:03:30Z")

</div>

@simitt Thanks for this.

Does the secret\_token only allow the writing of data related to APM? i.e. no one can use it to update pre-existing data / read data

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [December 12, 2019, 2:20am UTC](https://discuss.elastic.co/t/create-multiple-secret-tokens/211458/4 "2019-12-12T02:20:09Z")

</div>

@Matthew_Petrie the secret token is only usable with the APM Server, so you can only use it for writing data to APM indices (transactions, spans, etc.), and querying APM agent config. You can't use it to read/write any non-APM related data.

---

<div class="post-metadata">

**Author:** ![Matthew\_Petrie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_petrie/32/59145_2.png) [@Matthew\_Petrie](https://discuss.elastic.co/u/Matthew_Petrie)\
**Post date:** [December 12, 2019, 9:40am UTC](https://discuss.elastic.co/t/create-multiple-secret-tokens/211458/5 "2019-12-12T09:40:22Z")

</div>

@axw thanks very much! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 2, 2020, 5:40am UTC](https://discuss.elastic.co/t/create-multiple-secret-tokens/211458/6 "2020-01-02T05:40:30Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
