Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Encoding data metho...
 
Notifications
Clear all

Encoding data method for the API key

7 Posts
2 Users
0 Reactions
6,741 Views
(@sogeti)
Posts: 135
Active Member
Topic starter
 
[#5038]

Hi,

We have a problem with the using of the API Key.
We used the GET method and succeeded seeing datas. Then, we encrypted the datas in AES 256 but we are facing a problem when we tried to use the POST method.
We have this error : {"error":"invalid API query", "message":"'data' is not correctly encoded for method POST. Request for correct API KEY"}. We tried several times and have the same error.

Do you think this problem can be caused by the encoding data method. Are we supposed to use base64 for the API ?
Also, where can we modify the AES encryption code, in which file ?

Thank you in advance.


 
Posted : 22 Mar 2018 13H22
(@babynus)
Posts: 14952
Member Admin
 

You must encrypt with AES 128, using API Key.
Unless you define $aesKeyLength in parameters.php default is 128 (not 256 as it is illegal in some countries)

$data=AesCtr::encrypt($data, $apiKey, Parameter::getGlobalParameter('aesKeyLength'));

 
Posted : 22 Mar 2018 18H08
(@sogeti)
Posts: 135
Active Member
Topic starter
 

We checked the file fileconfig/parameters.php but we don't have $data and $aesKeyLength.
Is it normal ?
Are we supposed to add them ?


 
Posted : 22 Mar 2018 19H51
(@babynus)
Posts: 14952
Member Admin
 

Yes it is normal.
$aesKeyLength is not defined by default, and encryption uses 128bits.
You must define it yourself if you want to change this


 
Posted : 22 Mar 2018 19H53
(@sogeti)
Posts: 135
Active Member
Topic starter
 

Thank you.
But we don't have the line with $data neither.


 
Posted : 22 Mar 2018 19H59
(@babynus)
Posts: 14952
Member Admin
 

No, the line is an example of what you have to write to encode data.


 
Posted : 22 Mar 2018 20H27
(@sogeti)
Posts: 135
Active Member
Topic starter
 

OK, thank you for your replies


 
Posted : 23 Mar 2018 12H36
Share:

Scroll to Top