Show TOC

Implementing Clickjacking Framing Protection in Your DevelopmentsLocate this document in the navigation structure

If your application does not use the UI frameworks supported by SAP, you must implement your own solution.

Procedure

  1. Check whether protection is available and activated.
    • For SAP NetWeaver Application Server ABAP, check that the implementations from central SAP Note 2142551 Information published on SAP site are available in your system.

    • For Web Dynpro ABAP, check that the implementations from SAP Note 1872800 Information published on SAP site are available in your system.

      Enable the relevent ICF nodes and make at least one entry into table HTTP_WHITELIST for ENTRY_TYPE=30 to activate the protection.

      Note

      Please be aware that this might activate protection also for other frameworks.

    Other applications servers are not supported by SAP by default. It depends on the server-specific implementation for how this could be determined.

  2. Get the style sheet.

    Generate the style tag by using CL_UICS_WHITELIST_CHECK->GENERATE_FP_STYLE_TAG( ). The result of the method call can be taken directly into the HTML page.

    Other applications servers are not supported by SAP by default. It depends on the server-specific implementation for how this could be determined.

  3. Get the JavaScript

    Generate the script tag by using CL_UICS_WHITELIST_CHECK->GENERATE_FP_SCRIPT_TAG( ). The method provides the possibility to define several parameter like the error messages or to provide a predefined whitelist. The result of the method is a reference to the systems whitelist service containing all required parameters.

    Other applications servers are not supported by SAP by default. It depends on the server-specific implementation for how this could be determined.

  4. Implement a whitelist service.

    If you are using another application server than SAP NetWeaver Application Server, implement your own service to provide a whitelist to the applications. The service must be reachable via URL in form according to one of the following examples:

    • http(s)://host.domain.com(:<port>)/<serviceUrl>?parentOrigin=<URL of parent>&appl=<ownLocation.pathname>

    • http(s)://host.domain.com(:<port>)/<serviceUrl>??parm1=value1&…&parentOrigin=<URL of parent>&appl=<ownLocation.pathname>

    The <serviceURL> must be specified when calling the JavaScript as a parameter. For example in SAP NetWeaver Application Server ABAP this is /sap/public/bc/uics/whitelist/service.

    The origin of the parent is determined by the script using postMessage technology. The path of the application is required to have a possibility to filter by application. Application-based whitelisting is currently not supported.

    The javascript implementation of ClickjackingProtection.js works with responses from the whitelist service, which looks as follows:

    {"version":"1.0","active":true,"origin":"<parentorigin>","framing":false}

    {"version":"1.0","active":true,"origin":"<parentorigin>","framing":true}

  5. Implement clickjacking framing protection into a framework.

    Find the right location and merge the style sheet and the JavaScript into the content.