Hi,
I am using https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/
to authenticated, I have registered the app and then I am trying to create the user using the api.
I am following proper URL too.
<a href="https://api.atlassian.com/ex/jira/%7Bcloudid%7D/%7Bapi" target="_blank" rel="nofollow noopener noreferrer">https://api.atlassian.com/ex/jira/{cloudid}/{api</a>}
I am getting this error.{"errorMessages":["OAuth 2.0 is not enabled for method: POST /rest/api/2/user/"]}
I tried different solution but nothing worked for me.
Hello @ankit
The error message is only telling what is true... that endpoint does not support OAuth 2.0, exactly as per that endpoint's documentation:
Create userExperimental. POST /rest/api/2/userCreates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is available this resource will be deprecated.If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have access to Jira, the operation returns a 400 status.Permissions required: Administer Jira global permission---> Connect apps cannot access this REST resource <---
Experimental. POST /rest/api/2/user
Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is available this resource will be deprecated.
If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have access to Jira, the operation returns a 400 status.
Permissions required: Administer Jira global permission
---> Connect apps cannot access this REST resource <---
Also, refer to the corresponding feature request JRACLOUD-43171
@[deleted]Thank you very much for the support. Can you please guide me what's an alternative to Create Users/Terminate users?
We are using OAuth 2.0 to perform and action on users behalf and once we have access token we want to create/terminate users based on the request
If we can create atlassian account that should be sufficient I guess.
There is no 'alternative'. Atlassian doesn't want you creating / deleting / editing users from within a Connect / Forge / other app using credentials based on any user's granted OAuth token.
Google 'jira oauth 2 delete users' to read where others have asked the same question, like this one, and gotten the same answer.
Google 'jira connect app delete users' to read all the articles, like this one, that discuss the topic.
I agree 100% but there should be a way to escalate restriction.
Thanks David.
It looks like you're new here. Sign in or register to get started.