# Understanding token scope difference

**URL:** <https://discourse.jupyter.org/t/understanding-token-scope-difference/10467>\
**Category:** JupyterHub\
**Created:** [August 23, 2021, 9:24pm UTC](https://discourse.jupyter.org/t/understanding-token-scope-difference/10467 "2021-08-23T21:24:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ktaletsk](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/ktaletsk/32/528_2.png) [@ktaletsk](https://discourse.jupyter.org/u/ktaletsk)\
**Post date:** [August 23, 2021, 11:39pm UTC](https://discourse.jupyter.org/t/understanding-token-scope-difference/10467/2 "2021-08-23T23:39:59Z")

</div>

I narrowed it down to different parameters in call to …

JUPYTERHUB\_API\_TOKEN is generated inside User.spawn:

> <https://github.com/jupyterhub/jupyterhub/blob/dd7f035158b6198335144cde3cf2f2b37b897506/jupyterhub/user.py#L563>

with this call:

```auto
api_token = self.new_api_token(note=note, roles=['server'])

```

Requesting the token through command line calls:

> <https://github.com/jupyterhub/jupyterhub/blob/dd7f035158b6198335144cde3cf2f2b37b897506/jupyterhub/app.py#L233>

```auto
token = user.new_api_token(note="command-line generated")

```

As I can see, User.spawn calls has additional parameter `roles=['server']`, whereas another call does not. Indeed, removing `roles=['server']` parameter and reinstalling JupyterHub yield two identical scopes.

I am still wondering, why this difference exists and how would I get this behavior without forking JupyterHub…

---

_[View the full topic](https://discourse.jupyter.org/t/understanding-token-scope-difference/10467)._
