# Machine 2 Machine communication in OKTA

**URL:** <https://devforum.okta.com/t/machine-2-machine-communication-in-okta/29264>\
**Category:** OAuth/OIDC\
**Created:** [July 11, 2024, 10:47am UTC](https://devforum.okta.com/t/machine-2-machine-communication-in-okta/29264 "2024-07-11T10:47:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mansi](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mansi/32/5564_2.png) [@Mansi](https://devforum.okta.com/u/Mansi)\
**Post date:** [July 11, 2024, 10:47am UTC](https://devforum.okta.com/t/machine-2-machine-communication-in-okta/29264/1 "2024-07-11T10:47:53Z")

</div>

I have a following usecase:

I need to call multiple okta apis like /groups, /users etc for some internal requirements.  
How can I call these api using client\_credentials flow using client\_id and client\_secret without signin?

I am able to call api using private key pair, but is it possible to achieve the same using client\_id and client\_secret?

---

<div class="post-metadata">

**Author:** ![vk-giri](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/vk-giri/32/5178_2.png) [@vk-giri](https://devforum.okta.com/u/vk-giri)\
**Post date:** [July 11, 2024, 10:54am UTC](https://devforum.okta.com/t/machine-2-machine-communication-in-okta/29264/2 "2024-07-11T10:54:59Z")

</div>

Hi,

To interact with Okta APIs with a service app you can try following this doc [Implement OAuth for Okta with a service app | Okta Developer](https://developer.okta.com/docs/guides/implement-oauth-for-okta-serviceapp/main/)

You will need to use public private key pair since using client\_id/client\_secret is not supported with this

---

<div class="post-metadata">

**Author:** ![Mansi](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mansi/32/5564_2.png) [@Mansi](https://devforum.okta.com/u/Mansi)\
**Post date:** [July 12, 2024, 7:53am UTC](https://devforum.okta.com/t/machine-2-machine-communication-in-okta/29264/3 "2024-07-12T07:53:50Z")

</div>

@vk-giri Thanks for you response. I just wanted to know a few things:

Since we cannot ask our clients to create another service app via public private key pair,and using API access token , expiry is max 30 days for token, Is there any other way via which okta apis can be called? Just like in Azure, Apis can be called directly using client\_id, client\_secret and tenant\_id

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [July 12, 2024, 4:31pm UTC](https://devforum.okta.com/t/machine-2-machine-communication-in-okta/29264/4 "2024-07-12T16:31:01Z")

</div>

> The private\_key\_jwt client authentication method is the only supported method for OAuth service apps that want to get access tokens with Okta scopes.

As @vk-giri said and the documentation they linked to confirms, Okta does not support requesting Access Tokens that can be used against Okta’s endpoints using Client Credentials flow with Client ID:Client Secret auth, as we require that Private Key JWT client authentication be used for enhanced security.

---

<div class="post-metadata">

**Author:** ![Mansi](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mansi/32/5564_2.png) [@Mansi](https://devforum.okta.com/u/Mansi)\
**Post date:** [July 29, 2024, 12:19pm UTC](https://devforum.okta.com/t/machine-2-machine-communication-in-okta/29264/5 "2024-07-29T12:19:09Z")

</div>

Thanks guys for your prompt response! Will use private key to do the same.
