# Unable to create auth

**URL:** <https://community.influxdata.com/t/unable-to-create-auth/21656>\
**Category:** InfluxDB 2\
**Tags:** influxdb, getting-started\
**Created:** [September 10, 2021, 2:50pm UTC](https://community.influxdata.com/t/unable-to-create-auth/21656 "2021-09-10T14:50:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![apl](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/apl/32/8274_2.png) [@apl](https://community.influxdata.com/u/apl)\
**Post date:** [September 10, 2021, 2:50pm UTC](https://community.influxdata.com/t/unable-to-create-auth/21656/1 "2021-09-10T14:50:37Z")

</div>

Hello, I have a problem creating auth for new user.

Command line:

$ influx auth create -d test --user grafana --read-orgs  
Error: could not write auth with provided arguments: 400 Bad Request: invalid json structure: id must have a length of 16 bytes

influxdb logs:

influxdb | ts=2021-09-10T14:45:13.859808Z lvl=debug msg=Request log\_id=0WV\_qyDW000 service=http method=GET host=influx path=/metrics query= proto=HTTP/1.1 status\_code=200 response\_size=2854 content\_length=0 referrer= remote=10.10.20.13:53602 user\_agent=Go-http-client took=3.751ms body=  
influxdb | ts=2021-09-10T14:45:23.308231Z lvl=debug msg=“user find by ID” log\_id=0WV\_qyDW000 store=new took=0.066ms  
influxdb | ts=2021-09-10T14:45:23.309071Z lvl=debug msg=“orgs find” log\_id=0WV\_qyDW000 store=new took=0.296ms  
influxdb | ts=2021-09-10T14:45:23.309158Z lvl=debug msg=“Orgs retrieved” log\_id=0WV\_qyDW000 handler=org org=[0xc003b44d80]  
influxdb | ts=2021-09-10T14:45:23.310218Z lvl=debug msg=Request log\_id=0WV\_qyDW000 service=http method=GET host=influx path=/api/v2/orgs query=“org=Home” proto=HTTP/1.1 status\_code=200 response\_size=699 content\_length=0 referrer= remote=10.10.20.13:53602 user\_agent=influx took=2.635ms body=  
influxdb | ts=2021-09-10T14:45:23.314902Z lvl=debug msg=“user find by ID” log\_id=0WV\_qyDW000 store=new took=0.053ms  
influxdb | ts=2021-09-10T14:45:23.315198Z lvl=debug msg=“users find” log\_id=0WV\_qyDW000 store=new took=0.124ms  
influxdb | ts=2021-09-10T14:45:23.315260Z lvl=debug msg=“Users retrieved” log\_id=0WV\_qyDW000 handler=user users=[0xc00178e4c0]  
influxdb | ts=2021-09-10T14:45:23.315881Z lvl=debug msg=Request log\_id=0WV\_qyDW000 service=http method=GET host=influx path=/api/v2/users query=“name=grafana” proto=HTTP/1.1 status\_code=200 response\_size=206 content\_length=0 referrer= remote=10.10.20.13:53602 user\_agent=Date took=1.519ms body=  
influxdb | ts=2021-09-10T14:45:23.320606Z lvl=debug msg=“user find by ID” log\_id=0WV\_qyDW000 store=new took=0.077ms  
influxdb | ts=2021-09-10T14:45:23.320918Z lvl=error msg=“api error encountered” log\_id=0WV\_qyDW000 error=“invalid json structure: id must have a length of 16 bytes”  
influxdb | ts=2021-09-10T14:45:23.321199Z lvl=debug msg=Request log\_id=0WV\_qyDW000 service=http method=POST host=influx path=/api/v2/authorizations query= proto=HTTP/1.1 status\_code=400 response\_size=95 content\_length=-1 referrer= remote=10.10.20.13:53602 user\_agent=Sha took=1.371ms error=invalid error\_code=invalid body="{“description”:“test”,“orgID”:“72c497b17f12d6ee”,“permissions”:[{“action”:“read”,“resource”:{“id”:"",“orgID”:“72c497b17f12d6ee”,“type”:“orgs”}}],“userID”:“081f85db9b952000”}\n"

Thank you.

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [September 13, 2021, 6:54pm UTC](https://community.influxdata.com/t/unable-to-create-auth/21656/2 "2021-09-13T18:54:56Z")

</div>

Hello @apl,  
Have you set up an InfluxDB CLI configuration already?

> **[influx config create | InfluxDB OSS 2.6 Documentation](https://docs.influxdata.com/influxdb/v2.0/reference/cli/influx/config/create/#related)**
>
> The influx config create command creates a InfluxDB connection configuration.

And what type of token did you use to create it? You have to use the UI to create an all-access token that enables you to create a CLI config that has permissions to create new tokens.

---

<div class="post-metadata">

**Author:** ![dan-moran](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dan-moran/32/5885_2.png) [@dan-moran](https://community.influxdata.com/u/dan-moran)\
**Post date:** [October 4, 2021, 7:35pm UTC](https://community.influxdata.com/t/unable-to-create-auth/21656/3 "2021-10-04T19:35:43Z")

</div>

@apl if you were running with v2.1.0 of the `influx` CLI, there was a bug in `auth create` that caused empty resource IDs to incorrectly be sent in requests. It’s been fixed as of v2.1.1 of the CLI.

---

<div class="post-metadata">

**Author:** ![Aakarshit\_Agarwal](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/aakarshit_agarwal/32/11212_2.png) [@Aakarshit\_Agarwal](https://community.influxdata.com/u/Aakarshit_Agarwal)\
**Post date:** [October 13, 2022, 8:06pm UTC](https://community.influxdata.com/t/unable-to-create-auth/21656/4 "2022-10-13T20:06:10Z")

</div>

./influx auth create --org my\_org\_name --all-access  
Error: could not write auth with provided arguments: 403 Forbidden: permission read:orgs/2d8226e2e09XXXX/instance is not allowed: read:orgs/2d8226e2e0929XXXX/instance is unauthorized

I am getting this while creating the token, need it so that I can use the [`influx config create`](https://docs.influxdata.com/influxdb/v2.4/reference/cli/influx/config/create/) further

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [October 17, 2022, 4:51pm UTC](https://community.influxdata.com/t/unable-to-create-auth/21656/5 "2022-10-17T16:51:56Z")

</div>

Hello @Aakarshit_Agarwal,  
Welcome!  
To get your first token, you either have to setup through the UI or through the CLI.

> **[influx setup | InfluxDB OSS 2.6 Documentation](https://docs.influxdata.com/influxdb/v2.4/reference/cli/influx/setup/)**
>
> The influx setup command walks through the initial InfluxDB OSS setup process, creating a default user, organization, and bucket.

> **[View API tokens in InfluxDB | InfluxDB OSS 2.6 Documentation](https://docs.influxdata.com/influxdb/v2.4/security/tokens/view-tokens/)**
>
> View API tokens in InfluxDB using the InfluxDB UI, the influx CLI, or the InfluxDB API.
