SAML 2.0 – Automatic redirect to default IdP

Published by Tobias Hofmann on

5 min read

SAP NetWeaver ABAP can be configured to use SAML 2.0 for Single Sign-on. You have to specify a default SAML 2.0 IdP to handle the user logons. After NW ABAP is configured, and the users are accessing a protected services like SAP WebGui, they are presented a screen asking you to select the SAML 2.0 IdP.

This is the standard NW ABAP logon screen when configured to use SAML 2.0. It asks the user to select the correct IdP to carry out the logon. The login process continues when the user clicks on continue, and with the default IdP already preselected, this is an additional step you might want to skip. With more than one IdP configured, the user is presented these too. Therefore, this step looks wrong and confusing to the average user. Their expectation is to see a logon screen, not a screen asking them to select an IdP – which in most cases the end user does not know what it means. The IdP can have a self-explanatory name, or (mostly) a technical name. Independently what the IdP name is, this screen is not what you should present to your users.

List active SAML 2.0 IdPs

The list of available IdP shown is defined in the SAML 2.0 configuration of NW ABAP. For each active SAML 2.0 IdP, an entry is shown. To see the list of active IdP, call transaction SAML2.

Transaction: SAML2

Select tab Trusted Providers.

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung

The active IdPs are shown in the dropdown list of the logon screen.

Automatically forward users to default SAML 2.0 IdP

From the list of IdP you can see if they are active – NameId configured – and one IdP is selected as default. Why is now the user not redirected automatically to the default IdP? Why does the user still have to select the IdP and trigger the redirect manually?

Open the configuration of your “Local Provider” and click on “Service Provider Settings”.

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung

In the section “Identity Provider Discovery: Common Domain Cookie (CDC)” the parameter “Selection Mode” defines if the user is automatically redirected to a IdP. By default, the value is set to “Manual”. This means that the user needs to select an IdP. To let the SP select an IdP automatically, change the value to “Automatic”.

Selection Mode: Automatic


You can test the automatic redirect by accessing SAP WebGui.


The user is now redirected automatically to the logon screen if the default SAML 2.0 IdP.

What happens underneath? The SP receives the request to webgui service and then sends back to the browser a response. The response contains a redirect to the default IdP.

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung

The call to webgui is answered with a redirect (302) and the SAMLRequest information is added in the location header.

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung
Ein Bild, das Text enthält.

Automatisch generierte Beschreibung

HTTP header location:


The above SAMLRequest decodes to:

<samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" AllowCreate="true"/
Let the world know

Tobias Hofmann

Doing stuff with SAP since 1998. Open, web, UX, cloud. I am not a Basis guy, but very knowledgeable about Basis stuff, as it's the foundation of everything I do (DevOps). Performance is king, and unit tests is something I actually do. Developing HTML5 apps when HTML5 wasn't around. HCP/SCP user since 2012, NetWeaver since 2002, ABAP since 1998.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.