REST API error for BulkClassification

Hello,

A few environment specifics to get this started: We're on SQL 2019 on all servers, Data Catalog is on 2.0.15.25662, I am using VS 2017 for SSIS package work, and I use the ZappySys SSIS tools to make REST API calls from within SSIS.

I am working to automate the classification of a particular system. I do understand that PowerShell is an option here, but it's my understanding this should all be doable through REST API calls and so I'd like to do that from SSIS if possible .To keep it simple, I am testing the process on a database that automatically generates new tables for auditing operations. I only need to apply two specific tags to any of the columns in newly created tables, so there is no need to check data type or anything like that. 

I've set up an authorization token. I have been able to successfully send GET requests to retrieve the columnIDs I need to work with (/api/v1.0/columns?). The issue I am having is when I send a PATCH request for BulkClassification there is a 400 error returned. And these appears to be the offending lines:
  • 2023-02-16 09:54:01.746 -06:00 [INFO] Antiforgery token validation failed. The required antiforgery cookie ".AspNetCore.Antiforgery.xmlG6Io3-iw" is not present. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery cookie ".AspNetCore.Antiforgery.xmlG6Io3-iw" is not present. at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)
  • 2023-02-16 09:54:01.747 -06:00 [INFO] Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter'.
The same authorization token used in the PATCH for BulkClassification is used for the GET on columns. When comparing the cURL requests displayed by the API section of the site I am not seeing any specific headers I am missing. And the JSON body I am sending through the REST API works perfectly fine if I paste it in to the API section of the site, so it seems the JSON body is valid. For the PATCH request on BulkClassification I am sending these headers:
  1. accept -- with a value of */*
  2. X-XSRF-TOKEN -- with a value that matches the exact token generated in the site
  3. Content-Type -- with a value of application/json
Any thoughts or assistance is appreciated.
Tagged:

Answers

  • Eddie DEddie D Posts: 1,807 Rose Gold 5
    Hi, thank you for your forum post.

    A support ticket has been created for you and I will contact you via the support ticket created, as I need to request log files that you most likely do not want to post on this public forum.

    Many Thanks
    Eddie 
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file