Skip to Content

SAML 2.0 SSO for SAPGui windows

This scenario is based on logon tickets, which are no longer recommended:

– SAP Moderator


You want to enable SAML Single Sign On for SAPGui windows.

You have these components in place: IdP, SAPGui windows, Internet Explorer and SAP NetWeaver AS ABAP 7.02 or higher.

SAPGui does not offer native support for SAML. To make this happen, we combine the legacy support feature of the ABAP SAML service provider with the SAPGui shortcut SSO using the MYSAPSSO2 cookie.


Solution components

  1. Enable SAML authentication on the ABAP system using transaction SAML2 and exchanging the metadata with your IdP.
    The important setting in this case is to set the value of “Legacy Systems Support (Issue Logon Ticket) to “On” in the SAML Local Provider Configuration.
  2. Build a BSP application that will establish the SAML SSO with the IdP. This BSP application takes the cookie from the browser and puts it in a SAPGui shortcut. More information around SAPGui shortcut SSO can be found here Single Sign-On for SAP Shortcuts – User Authentication and Single Sign-On – SAP Library

BSP application:

    • Start page launchGui.htm: grabs the cookie and navigates to the BSP page creating the shortcut file.


(source code attached in

    • Page createSapGuiShortcut.htm parses the cookie and creates a SAPGui shortcut file containing the MYSAPSSO2 logon ticket.


(source code attached in )

Put this BSP application in the “Default Application Path” of the “Assertion Consumer Service” setting of the SAML Service provider.


Now start an IDP initiated request. After successful authentication against the IdP, the BSP application takes the MYSAPSSO2 cookie from the browser session and puts it in the SAP shortcutfile. Opening the SAP shortcut file will initiate a SAP logon ticket SSO to SAPGui. Depending on a registry setting in windows, the user will get a popup to open the shortcut file or start the SAPGui immediately. More details about this setting and how to influence it can be found in this SAP note:

User mapping

In a typical scenario, the user names of the ABAP system will not be identical to the ones on the IdP. To facilitate this, you can use the user mapping as described here Mapping SAML Principals to AS ABAP User IDs – User Authentication and Single Sign-On – SAP Library

To enable this mapping, set the “Supported NameID Formats” in the trusted provider in the SAML configuration to “unspecified” and then in the details of “NameID Format” specify the source “Mapping in USREXTID table“. Then go to “Name ID Management“, select the user you want to map and select the Name ID Format “Unspecified” and add the user there. This will generate an entry in the table VUSREXTID. Alternatively, you can also populate that table directly as described in note

You must be Logged on to comment or reply to a post.
  • Hi Koen,

    We are implementing your scenario.  We have a non-sap vendor Identity Provider and that is connecting to our ABAP system which has been configured as you specified to act as a Service Provider.  Then on the ABAP system, we deployed the BSP application with the source code you had provided.  Now, when we enter the bsp application URL via the internet explorer browser, we see that it is redirecting to the identity provider where we provide our user credentials, then it comes back to our ABAP system domain and immediately we get the pop-up to launch the SAPgui shortcut.  When we open the shortcut, instead of automatically logging us into the system, we are having to type in our ABAP user ID and password.  Can you let us know what we might be missing?  Here is a workflow of what we are doing with screenshots:

    1) Initiate test by entering to URL of BSP application in browser:


    2) URL is directed to Identity provider domain for authentication where we enter AD user credentials of the Identity provider:Capture2.PNG

    3) After Identity provider authenticates, URL is now redirected back to Service Provider domain and BSP application is launched, which creates the sapgui shortcut pop-up:


    4) After opening the pop-up, get this prompt and say allow:


    5) Then, here is where we have the issue.  Instead of automatically logging into the SAP ABAP System, it is prompting for our ABAP User that is defined through SU01 (we have kept it same as Identity Provider AD account user).  So, I am forced to enter the abap user password:


    6) After entering the password, it asks for it another time.  Not sure why this is happening either.  Please advise on this as well:


    7) After entering it, now it finally logs into the system. Can you please advise where we are missing something?  Why does it prompt for ABAP user password?


    8) I have attached screenshots of how we defined the BSP application via SE80 as per downloading your source code:




    Does this mean SAML is not working?  Or is it a problem with the BSP application that you have given us?  Thanks for any feedback or help!

    • Hi Vikas,

      most probably the issue is that you are not having a mySAPSSO2 logon cookie.

      check these settings:

      1. The parmeters as described here: Activating HTTP Security Session Management on AS ABAP – User Authentication and Single Sign-On – SAP Library
      2. on the ABAP system in transaction strustsso2, make sure that your system is added to the ACL for logon ticket.
      3. In the configuration of the SP (transaction SAML2), make sure the flag “Legacy Systems support is set to “on”

      hope it helps


      • Hi Koen,

        Yes, I suspect the mySAPSSO2 cookie being as issue as well, but I have already done all the settings you had mentioned and still SSO doesn’t seem to work.

        1. Here are our http security session settings which show it is active.  Parameters are correct as well as per Activating HTTP Security Session Management on AS ABAP – User Authentication and Single Sign-On – SAP Library


        2.  In strustsso2, the SSF SAML2 Service Provider – E and SSF SAML2 Service Provider – S both have the ABAP system (ECD) defined in the ACL.



        3.  The SAML2 config settings for the service provider have already been turned on for legacy support so that it can issue logon tickets:


        As you can see all our settings match with the requirements of an SSO setup, yet still having issues.  Can you please advise?  Thanks!

        • Hi Vikas,

          all settings seem to be correct.

          can you test if you execute the function module CREATE_RFC_REENTRANCE_TICKET in SE37 if you get the SSO ticket?


        • Hi Vikas,

          Hope you are doing well.¬† I was just reading this blog and am having trouble accessing the source codes mentioned in the document.¬† Since you mentioned you have¬†deployed the BSP application with the source code author has provided, can¬†you please let me know where I can find the source¬†code¬†this is included in “” and “”?¬† Any suggestion is greatly appreciated.



  • Hi,
    Im implementing SSO with Google for work, the SAML part is working well , I try to implement the solution that you propouse in your blog but is not working.
    The system dont take the cookie from the launchgui.htm to the createsapguishortcut page, I see the MYSAPOOS2 cookie on the launchgui.htm
    you have any advice?_

  • Hi all,

    I had the same issue with the cookie not being passed to the shortcut. Instead of getting the cookie from the browser I used the FM CREATE_ RFC_REENTRANCE_TICKET mentioned by Koen to get the MYSAPSSO2 token directly from ABAP application into the var “mysapsso2” and it worked for me.
    Wondering if this is working only in my scenario due to some config or it also works for you…

    Diego I. Yaryura

    • Hi Diego,

      thanks for the response. That is actually how I have implemented it now too. Getting the cookie from the browser is often problematic since getting the cookie from the browser it is typically blocked for security reasons.


    • sure,

      put this code in the onCreate event of the bsp page.


         shortcut_file      TYPE string,
         X_shortcut_file    TYPE xstring,
         mysapsso2_cookie   TYPE string,
         codepage           TYPE abap_encod,
         exceptioncx_bcs    TYPE REF TO cx_bcs.
            ticket                 = mysapsso2_cookie
            ticket_logon_disabled  = 1
            ticket_creation_failed = 2
            kernel_too_old         = 3
            OTHERS                 = 4.
        CONCATENATE              '[System]'                             cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file 'Name='          sy-sysid             cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file 'Client='        sy-mandt             cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file '[User]'                              cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file 'Name='          sy-uname             cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file 'at="MYSAPSSO2=' mysapsso2_cookie  '"' cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file '[Function]'                          cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file 'Command=SMEN'                        cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file '[Options]'                           cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
        CONCATENATE shortcut_file 'Reuse=0'                             cl_abap_char_utilities=>cr_lf INTO shortcut_file. "#EC NOTEXT
            X_shortcut_file  = cl_bcs_convert=>string_to_xstring( iv_string = shortcut_file ).
          CATCH cx_bcs INTO exceptioncx_bcs.
      *   Shortcutfile creation failed in creating xstring.
           object_s            = X_shortcut_file
           content_type        = 'application/x-sapshortcut'
           response            = runtime->server->response
           navigation          = _M_navigation ).


  • Koen Van Loocke,

    The code attachments for the BSP application appear to still be missing. Would it be possible to re-attach them or provide a way for us to see them?

    We are trying to enable SAML2 authentication for use with the SAPGui for accessing the ABAP systems and this blog appears to be exactly what we need.

    Any assistance would be greatly appreciated.

    Thank-you in advance,

    Deb Nugent.


  • Koen Van Loocke,


    We are trying to install the BSP application. Would you mind to let us know where can I download the source zip files.


    Ronnie Lau


  • Hi koen,


    Hope you are doing well.¬† We are working with the 3rd party IdP and are following this document.¬† However the source code which was mentioned in the document “” and” are not accessible, can you please let us know where we can find both zip files?


    Any suggestion is greatly appreciated.



  • Dear experts,
    Hope everyone is safe and healthy, thank you for the code and event handler it worked in the Internet Explorer but it does not run in Chrome 80 and Safari. In Chrome its simply saves the htm file locally. Any idea how to make it worked for Chrome and Safari  browsers? Please advise.