0

how can a open the sophos-report in a new browser tab? I upload a file to static file analysis with nodejs. I have a access token the jobId and the url. But when I open the url for the html-report I become: error "unauthorized" So I have to use the authorization token to access the page in the browser. But how?

thank for help

  • For example I try to use https://Endpointurl?Authorization=Bearer 00D2w000000kc19!AQ0.. or ?token= or ?Bearer%2B00D2w0.. how is the spec for the sophos endpoint https://de.api.labs.sophos.com/analysis/file/static/v1 – penguine Jun 18 '20 at 09:14
  • You should provide the token in the Authorization header instead of query string. https://api.labs.sophos.com/doc/analysis/file/static.html – László Katona Jun 22 '20 at 06:36

2 Answers2

1

You must authenticate yourself to obtain the HTML report. After that you can serve the returned HTML document (which is the body of the previous API call) as the HTML page, a downloadable file or you could embed it into you HTML page as an HTML object.

For rendering the report you need JavaScript enabled. It means that the tool used for rendering the returned HTML report was not supporting JavaScript.

László Ács
  • 149
  • 1
  • 9
0

I was confused because:

We're sorry but the report doesn't work properly without JavaScript enabled. Please enable it to continue.

so I think, when I save the reports it couldn´t work correct.

now I save the report and it work´s fine. It seems you do not need javascript. And so I don´t need a URL authentisation string.

  • 2
    The HTML report is rendered with JavaScript. Once you save it and open it in a browser it can be rendered. The missing JavaScript error suggest that you tried to open/render the report with a tool which did not support JavaScript. – László Ács Jun 19 '20 at 07:12