OAuth 2.0 is not enabled for this method

Volodymyr OSTAPIV April 8, 2020

Hello folks!
We are trying to get options for custom field as described here:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-customField-fieldId-option-get
but seems like this works with login\password credentials only and for OAuth flow it says "OAuth 2.0 is not enabled for this method."

Are there any plans to support OAuth 2.0 for this particular endpoint? Such a limitation is quite disappointing ...

Would appreciate any suggestions \ workarounds

2 answers

2 accepted

1 vote
Answer accepted
Beata Szturemska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 23, 2020

Hi!
I'd like to let you know that I have enabled

/customField/{fieldId}/option 

endpoints for OAuth and now you can use it in 3LO apps.


Do not hesitate to reach us when you are facing any other issues.
Enjoy!

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 10, 2020

Hello @Volodymyr OSTAPIV ,

Welcome to the Atlassian community!

If I understand correctly, you are able to call the Get options for field REST API endpoint (GET /rest/api/3/customField/{fieldId}/option) using Basic Authentication with email address and API Token, but this is not working when using Oauth 2.

This looks similar to what is discussed in the below thread:

In there the issue was caused by the bug tracked as: [JRACLOUD-72126] Using Latest API reports OAuth is not enabled

Can you kindly check if this is the same issue?

In case it is not, please call the REST API endpoint again using Curl making sure to include the -D- flag to print the whole header and paste the response in your reply, making sure to remove/hide the sensitive data (e.g. token, instance name, etc.) .

 

Cheers,
Dario

Volodymyr OSTAPIV April 10, 2020

Hi Dario!

Here https://jira.atlassian.com/browse/JRACLOUD-72126 people are able to hit `V3` endpoint and issue appears for the `latest` only.

In my case it doesn't work for V3 either (when using OAuth 2.0), but the same mechanism allows to access almost all the endpoints. I think its a Jira API limitation because all the doc pages but this have OAuth scopes required mentioned.

 

I will try to figure out request details follow up. But could you please check maybe its documented limitation.

 

Regards, Volodymyr

Volodymyr OSTAPIV April 10, 2020

Here are request details:

HttpRequest{method=GET, uri=https://api.atlassian.com/ex/jira/91d237d6-0c68-47c8-a8f6-885f45dfc126/rest/api/3/customField/10036/options, headers=[Pair{Authorization=Bearer ey#REDACTED#mg}, Pair{ATL-TraceId=1364dd31-19a5-4530-85be-547c914ca5f0}], body=null}

Nothing special... 

Volodymyr OSTAPIV April 10, 2020

Headers from curl:

HTTP/2 403 

vary: Accept-Encoding,Accept-Encoding

content-type: application/json;charset=UTF-8

strict-transport-security: max-age=315360000; includeSubDomains; preload

date: Sat, 11 Apr 2020 06:21:06 GMT

x-request-id: c60dabe49804393f

x-arequestid: 816a81bb-5842-4a19-b00a-282a665e39f9

x-application-context: Stargate:prod,prod-euwest:8080

x-xss-protection: 1; mode=block

timing-allow-origin: *

x-content-type-options: nosniff

micros-issuer: micros/edge-authenticator

x-frame-options: SameOrigin

expect-ct: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400

 Response:

{"errorMessages":["OAuth 2.0 is not enabled for this method."]}
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 14, 2020

Hello @Volodymyr OSTAPIV ,

I have checked with DEV and I got confirmation that those endpoints are indeed not enabled for Oauth2 and that you should use the ones for apps instead:

These endpoints are not enabled for 3LO apps.

Instead use this ones:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-group-Issue-custom-field-options--apps-

 

Can you kindly confirm above endpoints are working for you?

 

Cheers,
Dario

Volodymyr OSTAPIV April 15, 2020

Hi Dario.

1. The documentation says that endpoint is used for custom fields created by Connected Apps and this is not a case.

2. Tried to GET from rest/api/3/customfield_10035/option (customfield_10035 is my custom field key) and got 404

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2020

Hi @Volodymyr OSTAPIV ,

 

As mentioned in the documentation:

fieldKey REQUIRED

string

 

The field key is specified in the following format: $(app-key)__$(field-key). For example, example-add-on__example-issue-field. To determine the fieldKey value, do one of the following:

  • open the app's plugin descriptor, then app-key is the key at the top and field-key is the key in the jiraIssueFields module. app-key can also be found in the app listing in the Atlassian Universal Plugin Manager.
  • run Get fields and in the field details the value is returned in key. For example, "key": "teams-add-on__team-issue-field"

 

Also, still according to the documentation, Oauth 2 is only supported for apps (see below):

Which authentication method should I use?

 

 

Therefore, I have asked DEV to clarify:

 
  • If the given endpoints are working with Oauth2 (3LO) for apps or only with connect apps
  • If they only works for fields created by the app (using those methods)

 

In the meanwhile, can you le me know:

  1. How was the custom field you are trying to access created?
  2. Are you building an app or just authenticating REST API calls?
  3. Are you using OAuth 2.0 (3LO) for apps or OAuth for REST APIs or anything else?

 

For further details, you might want to see the below post on the developers community:

 

 

Finally, for the future, please notice that this is not the best place to get help on development  related questions. The right resources are listed in https://developer.atlassian.com/resources. 

Specifically:

 

Cheers,
Dario

Volodymyr OSTAPIV April 16, 2020

Hi Dario,

1. Field was created by the user from the Jira UI itself, it's not created by application.

2. We use https://developer.atlassian.com/cloud/jira/platform/oauth-2-authorization-code-grants-3lo-for-apps/ but we are not building Connected App, what we are going to build matches Other apps

3. I was able to hit that endpoint using login\password auth but we'd like to use OAuth 2.0 and it was actually the reason to ask.

Just to know if its really not supported and if it's going to be supported in the future 

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2020

Thanks for your quick reply @Volodymyr OSTAPIV ,

By reviewing the documentation, it definitely looks like: 

 

I am waiting for DEV to confirm this is the case and/or provide more details on plans to have this implemented.

 

Cheers,
Dario

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2020

Hello @Volodymyr OSTAPIV ,

After further discussing this with dev, I have been advised to open the below feature request to have those endpoints enabled for 3LO apps:

You may want to vote and watch the above feature request so that you will get notified in case of any update. The  feature will be addressed according to the Implementation of New Features Policy.

 

Also, for the future, please notice that this is not the best place to get help on development  related questions. The best resources are the ones listed in https://developer.atlassian.com/resources. 

Specifically:

 

Have a nice weekend.

 

Cheers,
Dario

Volodymyr OSTAPIV April 17, 2020

Great! Thanks!

Like Dario B likes this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2020

You are very welcome @Volodymyr OSTAPIV ! :) 

Also, I am accepting the answer so that this thread will be marked as answered. 

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events