# Understanding client\_credentials flow in terms of identity

**URL:** <https://community.auth0.com/t/understanding-client-credentials-flow-in-terms-of-identity/7441>\
**Category:** Get Help\
**Tags:** client\_credentials\
**Created:** [July 10, 2017, 7:33pm UTC](https://community.auth0.com/t/understanding-client-credentials-flow-in-terms-of-identity/7441 "2017-07-10T19:33:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick.brunmayr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patrick.brunmayr/32/7785_2.png) [@patrick.brunmayr](https://community.auth0.com/u/patrick.brunmayr)\
**Post date:** [July 10, 2017, 7:33pm UTC](https://community.auth0.com/t/understanding-client-credentials-flow-in-terms-of-identity/7441/1 "2017-07-10T19:33:01Z")

</div>

Hello  
I see many examples where public API’s using the client\_credentials flow. I am just wondering how this might be useful when i want to know about the identity of the user. This flow involves no end user so there is no user information available.

For example a customer of mine wants to access my API via a shell skript. He’s using the client\_credentials flow. But at the API endpoint all i can say is okay the access token is valid but i don’t know WHO the caller is without maintaining a seperate list from CLIENT\_ID to the customer.

**1. How is this done in practice ?**

**2 .Does that mean i would need a seperate CLIENT for each customer ? What if i have a million customers ?**

**3. How can my API run in context of the user without having identity information ?**

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [July 11, 2017, 6:03am UTC](https://community.auth0.com/t/understanding-client-credentials-flow-in-terms-of-identity/7441/2 "2017-07-11T06:03:28Z")

</div>

If the resource owner is the end-user, the Client Credentials grant wouldn’t be the flow to use. The Client Credentials grant flow is ideal for a CRON job, or other machine-to-machine flows where you don’t need to know the identity of the user. I suggest going through the API Authorization documentation to decide which flow would be best suited to your requirements:

> **[Which OAuth 2.0 Flow Should I Use?](https://auth0.com/docs/get-started/authentication-and-authorization-flow/which-oauth-2-0-flow-should-i-use)**
>
> Learn how to identify the proper OAuth 2.0 flow for your use case.

---

<div class="post-metadata">

**Author:** ![patrick.brunmayr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patrick.brunmayr/32/7785_2.png) [@patrick.brunmayr](https://community.auth0.com/u/patrick.brunmayr)\
**Post date:** [July 11, 2017, 3:43pm UTC](https://community.auth0.com/t/understanding-client-credentials-flow-in-terms-of-identity/7441/3 "2017-07-11T15:43:49Z")

</div>

Thank you for your answer but do you think i did not read all that stuff before ?

I can not imagine how Oauth can be benefitial to me protecting my REST APIs when i have no form of user interaction with a browser. There is no login or whatever. Just a plain REST endpoint, therefore the only option are client\_credentials grant or ressource owner grant. But do i really want my customers to put their login credentials in my client library for communicating with my API ? Is this real life ?

Thx

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/understanding-client-credentials-flow-in-terms-of-identity/7441/4 "2018-03-02T05:55:15Z")

</div>


