wultra / powerauth-mobile-sdk

PowerAuth Mobile SDK for adds capability for authentication and transaction signing into the mobile apps (ios, watchos, android).
https://www.wultra.com/product/wultra-mobile-security-suite/
Apache License 2.0
33 stars 13 forks source link

PATCH method errors on requestSignature #601

Closed BerniWittmann closed 1 month ago

BerniWittmann commented 1 month ago

I figured out that when calling requestSignature the HTTP method PATCH does not seem to be supported as it results in a Signature Error.

Example:

const auth = PowerAuthAuthentication.password("1234");
const signature = await powerAuth.requestSignature(auth, "PATCH", "/api/endpoint", "{ \"myJson\": \"body\" }")

The above throws an error, but switching it out for "PUT" or "POST" works perfectly fine. Note: I tested this on the ios simulator.

Luckily this is not a blocking issue for us right now, but still wanted to let you know

petrdvorak commented 1 month ago

Hi @BerniWittmann, thank you for the report - this is definitely something that can be improved. The HTTP methods are actually restricted in the mobile stack core, the RN wrapper only propagates the error, see: https://github.com/wultra/powerauth-mobile-sdk/blob/2702829bbfc9451ee308c91c46357f10ed7c5959/src/PowerAuth/PublicTypes.cpp#L125

We never got a hard request to go beyond the limited GET, POST, PUT, or DELETE methods (for some reason, we also support HEAD), but if this was a blocking at some point, feel free to escalate the issue and we will have a look with priority.

petrdvorak commented 1 month ago

Note: I will transfer this issue to https://github.com/wultra/powerauth-mobile-sdk

BerniWittmann commented 1 month ago

Thank you :)

Yes no issue for us, as we switched to PUT now, but just wanted to let you know :)

hvge commented 1 month ago

Hi @BerniWittmann, thank you for the report. I have already created a fix that will be released with the next SDK update in the 1.8.x release branch. If it’s important to you, I can release it sooner, but I would prefer to wait and resolve more issues in the update.

BerniWittmann commented 1 month ago

Hi @hvge Wow that was fast :) Please take all the time you need, no urgency required from my side