# Logging in via an API

**URL:** <https://community.auth0.com/t/logging-in-via-an-api/36432>\
**Category:** Get Help\
**Created:** [January 16, 2020, 6:15pm UTC](https://community.auth0.com/t/logging-in-via-an-api/36432 "2020-01-16T18:15:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![p.christodoulou2](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/p.christodoulou2/32/14302_2.png) [@p.christodoulou2](https://community.auth0.com/u/p.christodoulou2)\
**Post date:** [January 16, 2020, 6:15pm UTC](https://community.auth0.com/t/logging-in-via-an-api/36432/1 "2020-01-16T18:15:22Z")

</div>

Hi,

Using Python is there any way of logging in as a user with an API rather than physically typing in your username and password? i.e. I want an API that lets me provide {username, password, any other details} and gives me back an access token

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 16, 2020, 7:48pm UTC](https://community.auth0.com/t/logging-in-via-an-api/36432/3 "2020-01-16T19:48:51Z")

</div>

Hi @p.christodoulou2,

You can use the [resource owner password grant](https://auth0.com/docs/api/authentication#resource-owner-password) get a token directly with a API call containing a username/password.

If you are setting up a machine to machine connection without a user then you should use the [client credentials grant](https://auth0.com/docs/api/authentication#client-credentials-flow).

Hope this helps!

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 17, 2020, 8:57pm UTC](https://community.auth0.com/t/logging-in-via-an-api/36432/6 "2020-01-17T20:57:21Z")

</div>

A post was split to a new topic: [Would resource owner password API sign in work with passwordless?](https://community.auth0.com/t/would-resource-owner-password-api-sign-in-work-with-passwordless/36521)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 18, 2020, 7:48pm UTC](https://community.auth0.com/t/logging-in-via-an-api/36432/7 "2020-03-18T19:48:07Z")

</div>


