2017-03-22 5 views
0

現在、私はFIORIアプリケーションのフロントエンド側を確保しています。公式のドキュメントを読むと、信頼できるドメイン上のフレームにFIORIアプリケーションを読み込むことが可能であることがわかりました。そのためには、ホワイトリストを実装する必要があります。公式ドキュメントは、次の手順を実装する必要があることを規定している:フレームオプションにホワイトリストを使用する方法

  1. コールサービス:

    <meta name="sap.whitelistService" content="Whitelist.js"> 
    
  2. 設定し、信頼

    にframeOptionsを設定するホワイトリスト

    jQuery.sap.addUrlWhitelist(undefined, "https://webide-ad232er4.dispatcher.hana.ondemand.com/"); 
    jQuery.sap.validateUrl("https://webide-ad232er4.dispatcher.hana.ondemand.com/"); 
    
  3. data-sap-ui-frameOptions="trusted" 
    

    公式文書に記載されている手順をすべて実行した後、SAP Web IDEを使用してアプリケーションをフレームで起動し、通常はすべての処理を実行できます。しかし、これは事実ではありません。実行できるアクションはなく、ホワイトリストサービスが自分のドメインを認識していないようです。

誰かがこれを正しく実装する方法についてガイダンスを提供できますか?

P.S:これは私が使用した公式ドキュメントです:https://help.sap.com/saphelp_uiaddon10/helpdata/en/62/d9c4d8f5ad49aa914624af9551beb7/content.htm

EDIT

Index.htmlと

<!DOCTYPE HTML> 

<html> 
<!-- Copyright (c) 2014 SAP AG, All Rights Reserved --> 
<head> 

<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> 
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
<meta name="sap.whitelistService" content="ui.2sp.mm.purchorder.approve.uis2pmmpurchorderapproveExtension.Whitelist.js" /> 

<title>Extension Project in UShell Sandbox</title> 

<script type="text/javascript"> 
window["sap-ushell-config"] = { 
    defaultRenderer : "fiorisandbox", 
    services: { 
     NavTargetResolution: { 
     // navigation target resolution service is configured to resolve the empty location hash to the application 
      config : { 
       resolveLocal : [ { 
        "linkId" : "", 
        resolveTo : { 
         additionalInformation : "SAPUI5.Component=ui.s2p.mm.purchorder.approve.uis2pmmpurchorderapproveExtension", 
         applicationType : "URL", 
         url : "./" + window.location.search // pass URL query parameters to application 
        } 
       }] 
      } 
     } 
    } 
}; 
</script> 

<script src="test-resources/sap/ushell/bootstrap/sandbox.js" id="sap-ushell-bootstrap"></script> 
<script id="sap-ui-bootstrap" 
    src="resources/sap-ui-core.js" 
    data-sap-ui-libs="sap.m" 
    data-sap-ui-theme="sap_bluecrystal" 
    data-sap-ui-xx-bindingSyntax="complex" 
    data-sap-ui-compatVersion="1.16" 
    data-sap-ui-frameOptions="trusted" 
    data-sap-ui-resourceroots='{"ui.s2p.mm.purchorder.approve.uis2pmmpurchorderapproveExtension": "./"}'> 

</script> 

<!-- Create the unified shell default renderer control and add it to the page --> 
<script type="text/javascript"> 
sap.ui.getCore().attachInitEvent(function() { 
    sap.ushell.Container.createRenderer().placeAt("content"); 
}); 
</script> 
</head> 

<!-- UI Content --> 
<body class="sapUiBody" id="content"> 
</body> 
</html> 

Whitelist.js

jQuery.sap.addUrlWhitelist("https", "uis2pmmpurchorderapproveextens-ad232er4.dispatcher.hana.ondemand.com/?hc_reset"); 
jQuery.sap.validateUrl("uis2pmmpurchorderapproveextens-ad232er4.dispatcher.hana.ondemand.com/?hc_reset"); 

種類のよろしく、

ザカリア

+0

タイトルのUI5の言及をもう一度削除しました。 UI5への参照は、使用されたタグのためにかなり明確です。 – matbtt

+0

完璧、心配する必要はありません!誰かがこのトピックについてさらに助けてくれることを願っています。 –

答えて

0

私は仮定し、あなたのコード行がindex.htmlをの一部ですか? 完全な文脈を得るために完全なindex.htmlを投稿してください。

「Whitelist.js」も投稿してください。 これはあなたのホワイトリストサービスですか?

Security Conceptsのドキュメントもご覧ください。

「URLホワイトリストフィルタリング」の章には、次のように記載されています。 「jQuery.sap.addUrlWhitelist( "https"、 "sdn.sap.com"); 対応するaddUrlWhitelistステートメントでは、「未定義」を使用しています。 どうすればいいですか? "jQuery.sap.addUrlWhitelist(" https "、" webide-ad232er4.dispatcher.hana.ondemand.com ");"

New Features については、SAPノート2245332および2142551を参照してください。

+0

こんにちはSAP Fiori Crew、私は完全なindex.htmlとあなたが提案したWhitelist.jsを追加しました。私はまた、 "https"で未定義を置き換えようとしました。しかし、出力は同じです。ドキュメントに関しては、SAPがframeOptionsとWhitelistの周りに用意したすべてのドキュメントをチェックしました。残念ながら、すべての試みは成功しませんでした。あなたは私を正しい方向に向けるためのヒントはありますか? –

関連する問題