# Help understanding use of credentials?

**URL:** <https://community.auth0.com/t/help-understanding-use-of-credentials/130400>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [March 25, 2024, 7:49am UTC](https://community.auth0.com/t/help-understanding-use-of-credentials/130400 "2024-03-25T07:49:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oclipa](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@oclipa](https://community.auth0.com/u/oclipa)\
**Post date:** [March 25, 2024, 7:49am UTC](https://community.auth0.com/t/help-understanding-use-of-credentials/130400/1 "2024-03-25T07:49:53Z")

</div>

We are investigating using Auth0 for our machine-to-machine authentication and I want to check that I understand the credentials flow correctly.

Is this the correct approach? (as described in the [Client Credentials Flow docs](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow)):

1. For each client service an application is created, which generates a clientid and secret.
2. The client service generates a token using the clientid and secret.
3. The client service calls our service API using the token.

This seems straightforward, however I note that in the .NET SDK there is a [CreateCredentialsAsync API](https://auth0.github.io/auth0.net/api/Auth0.ManagementApi.Clients.ClientsClient.html#Auth0_ManagementApi_Clients_ClientsClient_CreateCredentialAsync_System_String_Auth0_ManagementApi_Models_ClientCredentialCreateRequest_System_Threading_CancellationToken_). Is this related to the M2M authentication flow, or is it is irrelevant? When would this API be used?

When would the [Credential](https://auth0.github.io/auth0.net/api/Auth0.ManagementApi.Models.Credential.html) object be used?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 25, 2024, 11:22pm UTC](https://community.auth0.com/t/help-understanding-use-of-credentials/130400/3 "2024-03-25T23:22:04Z")

</div>

Hi @oclipa,

Welcome to the Auth0 Community!

Yes, you have understood the client credentials flow correctly! 👏

As for the [CreateCredentialsAsync method](https://auth0.github.io/auth0.net/api/Auth0.ManagementApi.Clients.ClientsClient.html#Auth0_ManagementApi_Clients_ClientsClient_CreateCredentialAsync_System_String_Auth0_ManagementApi_Models_ClientCredentialCreateRequest_System_Threading_CancellationToken_) you shared, it is used to create a new client credential, which is separate from the client credentials grant flow.

Please read our [Application Credentials](https://auth0.com/docs/secure/application-credentials) documentation for more details.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![oclipa](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@oclipa](https://community.auth0.com/u/oclipa)\
**Post date:** [March 26, 2024, 7:56am UTC](https://community.auth0.com/t/help-understanding-use-of-credentials/130400/4 "2024-03-26T07:56:10Z")

</div>

Ah, OK, thanks.

So, if I understand correctly, that API is relevant to Private Key/Certificate credentials and allows a new credential to be created for an application. It is not relevant in the case where a client secret is used.

Does the new credential replace any existing credential, or is it an additional credential?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 27, 2024, 5:01pm UTC](https://community.auth0.com/t/help-understanding-use-of-credentials/130400/5 "2024-03-27T17:01:58Z")

</div>

Hi @oclipa,

Thanks for the reply.

You can have a maximum of 2 credentials configured. This is mentioned in: [Configure Private Key JWT Authentication](https://auth0.com/docs/get-started/applications/configure-private-key-jwt#credential-limits).

Cheers,  
Rueben

---

<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:** [April 10, 2024, 5:02pm UTC](https://community.auth0.com/t/help-understanding-use-of-credentials/130400/6 "2024-04-10T17:02:11Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
