"Create Group" REST API failed with XSRF check failed

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Low
    • None
    • Affects Version/s: 8.19.0, 9.4.0
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      "Create Group" REST API mentioned int the doc here failed with XSRF check failed.

      Steps to Reproduce

      Create a group using REST API as per the document here.

      kkumar4@K045XXPPGV Downloads % curl -u admin --request POST \
        --url 'https://instenv-471854-5sta.instenv.internal.atlassian.com/rest/api/latest/admin/groups?name=jiraadmins' \
        --header 'Accept: application/json;charset=UTF-8'
      Enter host password for user 'admin':
      XSRF check failed%
      

      Expected Results

      The group should create without XSRF check failure
      For example:

      kkumar4@K045XXPPGV Downloads % curl -u admin --request POST \
        --url 'https://instenv-471854-5sta.instenv.internal.atlassian.com/rest/api/latest/admin/groups?name=temp_users1' \
        --header 'Content-type: application/json' |jq
      Enter host password for user 'admin':
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100    39    0    39    0     0     39      0 --:--:-- --:--:-- --:--:--    39
      {
        "name": "temp_users1",
        "deletable": true
      }
      

      Actual Results

      Group creation fails via REST API with XSRF check failed error

      kkumar4@K045XXPPGV Downloads % curl -u admin --request POST \
        --url 'https://instenv-471854-5sta.instenv.internal.atlassian.com/rest/api/latest/admin/groups?name=jiraadmins' \
        --header 'Accept: application/json;charset=UTF-8'
      Enter host password for user 'admin':
      XSRF check failed%
      

      Workaround

      As per the document header is set accept

      curl --request POST \
        --url 'http://{baseurl}/rest/api/latest/admin/groups?name={name}' \
        --header 'Accept: application/json;charset=UTF-8'
      

      Replace this header with Content-type

      curl --request POST \
        --url 'http://{baseurl}/rest/api/latest/admin/groups?name={name}' \
        --header 'Content-type: application/json;charset=UTF-8'
      

            Assignee:
            David Zhu (Inactive)
            Reporter:
            Kalyan Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: