Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeviantArt API now requires CSRF token #55

Closed
y-young opened this issue Oct 31, 2022 · 0 comments
Closed

DeviantArt API now requires CSRF token #55

y-young opened this issue Oct 31, 2022 · 0 comments
Assignees
Labels
upstream Something not on our side

Comments

@y-young
Copy link
Owner

y-young commented Oct 31, 2022

Describe the bug
DeviantArt API (https://www.deviantart.com/_napi/da-user-profile/shared_api/deviation/extended_fetch?type=art&deviationid=) now requires a valid CSRF token to be passed via csrf_token parameter.

To Reproduce
Steps to reproduce the behavior:

  1. Send GET request to https://www.deviantart.com/_napi/da-user-profile/shared_api/deviation/extended_fetch?type=art&deviationid=93506493
  2. Returns error:
{
  "error": "invalid_request",
  "errorDescription": "Invalid or expired form submission",
  "errorDetails": {
    "csrf": "missing"
  },
  "status": "error"
}

Expected behavior
Should be able to get deviation details.

Additional context

  • An invalid CSRF token will return:
    {
      "error": "invalid_request",
      "errorDescription": "Invalid or expired form submission",
      "errorDetails": {
        "csrf": "invalid"
      },
      "status": "error"
    }
  • A valid token can be obtained by visiting the home page and retrieving from window.__CSRF_TOKEN__ ([deviantart] KeyError: 'deviation' mikf/gallery-dl#2983)
  • CSRF token must be used along with the cookies returned (userinfo), otherwise will be considered invalid
  • A valid token can be reused during multiple requests, expiration time is yet unknown
@y-young y-young added the upstream Something not on our side label Oct 31, 2022
@y-young y-young self-assigned this Oct 31, 2022
@y-young y-young closed this as completed in ea5b5d1 Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Something not on our side
Projects
Status: Done
Development

No branches or pull requests

1 participant