I'm working with Yodlee MFAs, in this case, captcha, and I'm wondering how to render the image field from this JSON response:
{
"isMessageAvailable":true,
"fieldInfo":{
"responseFieldType":"text",
"imageFieldType":"image",
"image":[
66,
77,
58,
116,
0,
0,
0,
0,
0,
0,
54,
0,
0,
0,
40,
0,
0,
0,
-91,
0,
0,
0,
45,
0,
0,
0,
1,
0,
32,
0,
0,
0,
0,
0,
4,
116,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-5,
-1,
0,
-1,
-1,
-1,
0,
-9,
-9,
-9,
0,
-1,
-5,
-1,
0,
-1,
-1,
-1,
0,
-1,
-5,
-1,
0,
-17,
-17,
-17,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-9,
-13,
-9,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-9,
-9,
-9,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-17,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0,
-1,
-1,
-1,
0
],
"minimumLength":-1,
"maximumLength":-1,
"displayString":"Please enter the text shown in the image"
},
"timeOutTime":99900,
"itemId":10014925,
"retry":false
}
For more information, you can read the following links: Link1, Link2
I would appreciate any help since I asked a Yodlee representative and he directed me here.
The CAPTCHA image is being returned in String which is byte array of image. You need to convert this string into byte array and then into image. You can do this by using JDK libraries i.e. no external libraries are required.
You can use these.
java.awt.image.BufferedImage;
java.io.BufferedReader;
java.io.ByteArrayInputStream;
For me this was a best solution:
$string = implode(array_map("chr", $image));
Here you can find different realizations: How can I convert array of bytes to a string in PHP?
来源:https://stackoverflow.com/questions/24388761/getmfaresponseforsite-rendering-array-as-a-captcha-image