1

突然,我的 Flex 应用程序无法再通过其 API 连接到 salesforce.com,我遇到了安全沙箱违规行为。登录凭据是正确的,我已经通过不同的方式尝试过它们,并且我在下面对它们进行了混淆。

这在今天早些时候工作得很好,从那以后我就没有编码了。

其他人遇到过这个或知道发生了什么吗?

这是返回给我的应用程序的异常

Method name is: login
'A997F86A-36E9-DDDC-EC6B-BBEE23101466' producer connected.
'A997F86A-36E9-DDDC-EC6B-BBEE23101466' producer sending message 'B89E5879-D7F7-E91E-2082-BBEE231054DD'
'direct_http_channel' channel sending message:
(mx.messaging.messages::HTTPRequestMessage)#0
  body = "<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/"><se:Header xmlns:sfns="urn:partner.soap.sforce.com"/><se:Body><login xmlns="urn:partner.soap.sforce.com" xmlns:ns1="sobject.partner.soap.sforce.com"><username>simon.palmer@***.com</username><password>***</password></login></se:Body></se:Envelope>"
  clientId = (null)
  contentType = "text/xml; charset=UTF-8"
  destination = "DefaultHTTPS"
  headers = (Object)#1
  httpHeaders = (Object)#2
    Accept = "text/xml"
    SOAPAction = """"
    X-Salesforce-No-500-SC = "true"
  messageId = "B89E5879-D7F7-E91E-2082-BBEE231054DD"
  method = "POST"
  recordHeaders = false
  timestamp = 0
  timeToLive = 0
  url = "https://www.salesforce.com/services/Soap/u/11.0"
Method name is: login
*** Security Sandbox Violation ***
Connection to https://www.salesforce.com/services/Soap/u/11.0 halted - not permitted from https://localhost/pm_server/pm/pm-debug.swf
'A997F86A-36E9-DDDC-EC6B-BBEE23101466' producer acknowledge of 'B89E5879-D7F7-E91E-2082-BBEE231054DD'.
'A997F86A-36E9-DDDC-EC6B-BBEE23101466' producer fault for 'B89E5879-D7F7-E91E-2082-BBEE231054DD'.
Comunication Error : Channel.Security.Error : Security error accessing url : Destination: DefaultHTTPS
Error: Request for resource at https://www.salesforce.com/services/Soap/u/11.0 by requestor from https://localhost/pm_server/pm/pm-debug.swf is denied due to lack of policy file permissions.
4

5 回答 5

1

You have to make sure to load the policy from the /services tree, the default policy at the root won't help you. You need to load this policy https://www.salesforce.com/services/crossdomain.xml

于 2008-11-27T18:38:18.080 回答
1

解决这个问题的方法是设置服务器协议和url如下:

apex = new Connection();    
apex.serverUrl = "https://na3.salesforce.com/services/Soap/u/14.0";
apex.protocol = "https";

但是,这似乎会造成用户被锁定的次要问题,因此无法连接的问题仍然存在。

更新: salesforce.com 已经承认了一个错误。请参阅我的其他相关帖子

于 2008-12-04T02:48:24.377 回答
0

您最近升级到 Flash Player 10 了吗?Flash player 10 在一定程度上改变了策略文件的工作方式,需要更新 crossdomain.xml 文件来解决这个问题。简而言之,Salesforce.com 可能还没有为用户升级到 Flash Player 10 做好准备。

于 2008-11-21T03:41:40.840 回答
0

我正在将文件从 flex 上传到 Google 文档。一切都在本地文件中运行,但是,当我们在 Salesforce(沙盒)中将 SWF 文件作为 S-control 上传时,连接到 Google 时会出现错误。请看下面的错误:

Error:[FaultEvent fault=[RPC Fault faultString="Security error accessing url"
faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTPS"] 
messageId="1F812836-1318-B845-AC01-F51AB1D11518" type="fault" bubbles=false 
cancelable=true eventPhase=2]

我们尝试了以下解决方案,但似乎没有任何效果: FLEX: - 在 bin-debug 文件夹中添加 crossdomain.xml:以下是跨域策略的内容。

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
     <allow-access-from domain="*" secure="false" />
<allow-http-request-headers-from domain="*" headers="*" secure="false" />
</cross-domain-policy>
  • 在初始化中使用了 flash.system.security.allowinsecuredomain/allowdomain(“*”)。
  • 还尝试将 connection.protocol 设置为 http Salesforce:
  • 在远程站点设置中禁用协议安全 o 设置 -> 管理设置 -> 安全控制 -> 远程站点设置  URL:http ://www.google.com.ph

与 Salesforce 的连接没有问题,但在上传页面初始化时,安全错误将专门出现在 onErrorFault 函数中。以下是代码片段:

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" width="534" height="462" verticalScrollPolicy="off" horizontalScrollPolicy="off"
creationComplete="init()" showCloseButton="true" close="{this.closeWindow(event)}" roundedBottomCorners="true">
<mx:Script>
<![CDATA[

private function init():void{
        Security.allowInsecureDomain("*");
        //<salesforce:Connection id="apex" sendRequest="sendRequestListener(event)" serverUrl="http://www.salesforce.com/services/Soap/u/10.0" protocol="http"/>   
        RESTProxyTest();
        send_data();
        arrAddedFiles = new Array();
        this.uploadGrid.dataProvider= this.acFiles; 
        this.title = "Attachment: "+this.selectedTimeSheetDetail.Project.label;
}

public function RESTProxyTest():void
    {
        _conn = new NetConnection();
        _conn.addEventListener(AsyncErrorEvent.ASYNC_ERROR, doAsyncError);
        _conn.addEventListener(IOErrorEvent.IO_ERROR, doIOError);
        _conn.addEventListener(SecurityErrorEvent.SECURITY_ERROR, doSecurityError);
        _conn.addEventListener(NetStatusEvent.NET_STATUS, doNetStatus);
        _conn.objectEncoding = ObjectEncoding.AMF3;

        _conn.connect(_url);
        _responder = new Responder(onResult, onFault);  

    }

private function send_data():void {
        userRequest.url = getLoginURL();
        userRequest.addEventListener(ResultEvent.RESULT, httpResult);
        userRequest.addEventListener(FaultEvent.FAULT, onErrorFault); 
        userRequest.send();
    } 

private function onErrorFault(obj:FaultEvent):void
    {
        Alert.show("Error:"+obj.toString());
    }

private function httpResult(obj:ResultEvent):void
    {
        trace(obj.toString());

        var result:String = obj.result as String;       
        var pos:int = result.lastIndexOf("Auth=");
        var auth:String = result.substr(pos + 5);
        txtAuth.text = StringUtil.trim(auth);
        placeCall();
    }

protected function placeCall():void
    {
        trace("placeCall");
        var headers:Array = ["Authorization: " + "GoogleLogin auth=" + StringUtil.trim(txtAuth.text)];
        var postVars:Array = [];         
        var uri:String = "http://docs.google.com/feeds/documents/private/full?showfolders=true"; 
        _conn.call("RESTProxy.request", _responder, uri, "get", new Array(), postVars, headers);
    }

private function getLoginURL():String
    {
        var url:String = 'https://www.google.com/accounts/ClientLogin?accountType=HOSTED_OR_GOOGLE&' +
        'Email=' + this.session.config.gmail + '&' +
        'Passwd=' + this.session.config.password + '&service=writely'; 

        return url;
    }   
]]>
</mx:Script>

<mx:HTTPService id="userRequest" useProxy="false" method="POST" contentType="application/x-www-form-urlencoded" showBusyCursor="true"/>
于 2009-04-30T03:49:18.137 回答
0

我解决了访问 Flash Player 配置面板的问题(我只是在开发环境中推荐它),在“全局安全”选项卡中,选择始终允许。

问候。

于 2009-09-16T16:30:34.617 回答