# tower-cli auth token?

**URL:** <https://forum.ansible.com/t/tower-cli-auth-token/29778>\
**Category:** AWX Project\
**Created:** [February 26, 2019, 4:49pm UTC](https://forum.ansible.com/t/tower-cli-auth-token/29778 "2019-02-26T16:49:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmakovey](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@dmakovey](https://forum.ansible.com/u/dmakovey)\
**Post date:** [February 26, 2019, 4:49pm UTC](https://forum.ansible.com/t/tower-cli-auth-token/29778/1 "2019-02-26T16:49:02Z")

</div>

I am building a CI job that is supposed to call tower-cli, and have  
noticed that:

$ tower-cli config  
....  
use\_token: false  
...

which leads me to believe there is a token-based authentication (vs  
user-based authentication) for the tower? Or is it simply a reference to  
token granted after user-based auth completed?

I've looked for references in  
[https://tower-cli.readthedocs.io/en/latest/#table-of-contents](https://tower-cli.readthedocs.io/en/latest/#table-of-contents) and other  
places but came up with nothing thus far.

Am I supposed to manually create "CI" user and auth with those credentials?

---

<div class="post-metadata">

**Author:** ![Christian\_Adams](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@Christian\_Adams](https://forum.ansible.com/u/Christian_Adams)\
**Post date:** [February 27, 2019, 4:31pm UTC](https://forum.ansible.com/t/tower-cli-auth-token/29778/2 "2019-02-27T16:31:43Z")

</div>

Hi Dmitry,

You are correct, there is a token-based authentication now for tower-cli.

$ `tower-cli login <your_username> `will prompt you for your Tower username and password, and will create an OAuth2 Personal Access Token on your behalf with that information. This will set the token value in the tower-cli config and will be automatically used for all subsequent tower-cli requests.

It is also possible for you to create an OAuth2 token yourself in tower and set it for tower-cli using the following command:  
`$ tower-cli config token <token-value>`

Thank you for bringing this up, we could probably make a separate section in the docs for this. Currently this is our docs coverage: [https://tower-cli.readthedocs.io/en/latest/quickstart.html?highlight=login](https://link.getmailspring.com/link/1551276579.local-212bfd8e-ba55-v1.5.3-420ce003@getmailspring.com/0?redirect=https%3A%2F%2Ftower-cli.readthedocs.io%2Fen%2Flatest%2Fquickstart.html%3Fhighlight%3Dlogin&recipient=YXd4LXByb2plY3RAZ29vZ2xlZ3JvdXBzLmNvbQ%3D%3D) and [https://tower-cli.readthedocs.io/en/latest/cli\_ref/index.html?highlight=login](https://link.getmailspring.com/link/1551276579.local-212bfd8e-ba55-v1.5.3-420ce003@getmailspring.com/1?redirect=https%3A%2F%2Ftower-cli.readthedocs.io%2Fen%2Flatest%2Fcli_ref%2Findex.html%3Fhighlight%3Dlogin&recipient=YXd4LXByb2plY3RAZ29vZ2xlZ3JvdXBzLmNvbQ%3D%3D)

Thanks,  
Christian
