# How I can get the account token after "authUser"?

**URL:** <https://discourse.getcockpit.com/t/how-i-can-get-the-account-token-after-authuser/2304>\
**Category:** Support\
**Created:** [March 13, 2022, 10:59am UTC](https://discourse.getcockpit.com/t/how-i-can-get-the-account-token-after-authuser/2304 "2022-03-13T10:59:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nastya97core](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@nastya97core](https://discourse.getcockpit.com/u/nastya97core)\
**Post date:** [March 13, 2022, 10:59am UTC](https://discourse.getcockpit.com/t/how-i-can-get-the-account-token-after-authuser/2304/1 "2022-03-13T10:59:03Z")

</div>

Can you tell me how I can get the account token? I assumed that after authorization I would get the “/api/cockpit/authUser” user token so I could continue, but I only get an array of user data and no token there.

```auto
1. active: true
2. email: "admin@yourdomain.de"
3. group: "admin"
4. i18n: "en"
5. name: "Admin"
6. user: "admin"
7. _created: 1646744373
8. _id: "20224ebf3333667c5d0001ad"
9. _modified: 1646744373

```

Can you tell me how I can get it?

---

<div class="post-metadata">

**Author:** ![ronaldaug](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/ronaldaug/32/260_2.png) [@ronaldaug](https://discourse.getcockpit.com/u/ronaldaug)\
**Post date:** [March 15, 2022, 5:20am UTC](https://discourse.getcockpit.com/t/how-i-can-get-the-account-token-after-authuser/2304/2 "2022-03-15T05:20:36Z")

</div>

I guess this is similar to this issue. Hope it helps.

> <https://github.com/agentejo/cockpit/issues/840>
>
> https://getcockpit.com/documentation/api/cockpit 
> I read the documentation and …it seems every "fetch" ajax request has to include a token key. 
> Form my experience with others API CMS, a user send a post request and a token key is returned. 
> 
> Probably, something like this
> 
> \`\`\`
> $.ajax({
> type: 'POST',
> url: 'http://mydomain.com/api/auth',
> data: {
> username: 'john@johndoe.com',
> password: 'johndoe'
> },
> success: function(response) {
> console.log('User token', response.jwt);
> },
> error: function(error) {
> console.log('Error : ', error);
> }
> });
> \`\`\`
> Do I have to generate a new token key in backend panel manually? 
> 
> Thanks in advance.
