Steps: Before make any API call to Sumsub endpoints, I have to create a signature in HEX format and also I have to get the number of seconds since Unix Epoch. I have to create this logic as a template for any kind of query to Sumsub endpoints.
Where can I add this javascript logic in order to be executed before each call?
I thought this would be a straightforward problem to solve, but it ended up being more intricate than I expected. At a high level, you should define a custom authentication flow on the resource itself in order to avoid having to redefine these headers on every single request.
Can I return an array in my response with both variables? I think so but could you clarify it to me please. Like "return [signature, timestamp]
To create the signature, I have to access to the current URL. What is the javascript variable where I can get the current method and the current URL?
I need some javascript libraries like "crypto" for HMACSHA256 encryption. I know that I can add some Libraries from settings in each App, but how can I test it from custom flow?