# How to programmatically get the Authorization code without requiring the user approval in OAuth 2.0

**URL:** <https://community.developer.atlassian.com/t/how-to-programmatically-get-the-authorization-code-without-requiring-the-user-approval-in-oauth-2-0/58326>\
**Category:** Jira Cloud\
**Tags:** oauth2, client-credentials-grant-type, jira-cloud, dotnet, rest-api\
**Created:** [May 16, 2022, 1:13pm UTC](https://community.developer.atlassian.com/t/how-to-programmatically-get-the-authorization-code-without-requiring-the-user-approval-in-oauth-2-0/58326 "2022-05-16T13:13:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArunVS](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@ArunVS](https://community.developer.atlassian.com/u/ArunVS)\
**Post date:** [May 16, 2022, 1:13pm UTC](https://community.developer.atlassian.com/t/how-to-programmatically-get-the-authorization-code-without-requiring-the-user-approval-in-oauth-2-0/58326/1 "2022-05-16T13:13:44Z")

</div>

We are building an backend application (using C# Dotnet) to interact with the JIRA cloud instance. We wanted to use an advanced authentication model instead of the basic auth using a username/API key. Hence, we tried the OAuth 2.0 approach but it looks like we need to have a manual approval to get the authorization code based on the below article. [https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/#1--direct-the-user-to-the-authorization-url-to-get-an-authorization-code](https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/#1--direct-the-user-to-the-authorization-url-to-get-an-authorization-code)

We were able to get the authorization code using the callback URL and exchange the authorization code. The only problem in this flow is the manual approval process which needs user interaction.

Please let us know if there is a way to programmatically get the Authorization code without requiring the user approval each time we wanted to interact with the rest API from the Dotnet C# application. We wanted to avoid using the basic auth for security reasons. Also, let us know if there is any other way of secure authentication model to make the JIRA rest API calls.

Thanks

---

<div class="post-metadata">

**Author:** ![OjaseEmmanuval](https://avatars.discourse-cdn.com/v4/letter/o/ce73a5/32.png) [@OjaseEmmanuval](https://community.developer.atlassian.com/u/OjaseEmmanuval)\
**Post date:** [November 10, 2023, 1:25am UTC](https://community.developer.atlassian.com/t/how-to-programmatically-get-the-authorization-code-without-requiring-the-user-approval-in-oauth-2-0/58326/2 "2023-11-10T01:25:49Z")

</div>

@ArunVS Have you got a solution for the above problem. We are trying to implement a similar solution and stuck with the same issue you have. Can you please help.

Thanks,  
Ojase

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [November 10, 2023, 11:38am UTC](https://community.developer.atlassian.com/t/how-to-programmatically-get-the-authorization-code-without-requiring-the-user-approval-in-oauth-2-0/58326/3 "2023-11-10T11:38:14Z")

</div>

@ArunVS,

Please see my reply on @OjaseEmmanuval’s similar thread:

> [@How to programmatically get the Authorization code without the user approval in OAuth 2.0](https://community.developer.atlassian.com/t/how-to-programmatically-get-the-authorization-code-without-the-user-approval-in-oauth-2-0/74586/2):
>
> @OjaseEmmanuval, You cannot. As the title of the documentation indicates, the Atlassian OAuth 2 implementation only implements “3LO”, formally known as the client authorization flow, which requires human intervention. OAuth 2 specifies the client credentials flow for this scenario, but Atlassian hasn’t implemented it. Please watch, vote, and comment on: [https://jira.atlassian.com/browse/OAUTH20-176](https://jira.atlassian.com/browse/OAUTH20-176)
