douwen2158 2018-08-14 05:29
浏览 124

解密php中的salesforce自定义字段

I am creating a signin page in php using heroku, I have created a custom text(encryption) field in Salesforce which i want to decrypt in php in order to compare the user entered data with the decrypted data. How can i achieve this? Kindly help if anyone has solution for the same.

while ($row = pg_fetch_row($result)) {
    if (base64_decode($row[1]) == $_POST['password']) {
        echo "You are a validated user/n";
        echo "HELLO" . $_POST['email'];
        exit;
    }
}

Code:

$query = "SELECT Email , Password__c FROM salesforce.contact ;"; 
$result= pg_query($query); 
$row = pg_fetch_row($result);
echo "Row password " .$row[1]; 
echo "<br>"; 
echo "Post password " .$_POST['password']; 
echo "<br>"; 

Output: ($row[2]==>)Row password *********** Post password 123456789 enter image description here

  • 写回答

1条回答 默认 最新

  • dpp89959 2018-08-14 06:52
    关注

    The problem here is that you don't know how the data in Salesforce is encrypted. By default, the data returned from a query on those field is just ******, and there's no way for an external application to decrypt this.

    If you want to see the values in those fields, you need the querying user to have the View Encrypted Data permission, which can be given on the user profile or through a permission set.

    enter image description here

    Once your user has this permission, they will be able to see the plain-text values of the encrypted text field in:

    • the ui
    • the bulk api
    • the rest api
    • the soap api
    • debug logs (although not when serializing the containing sObject)
    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看