cancel
Showing results for 
Search instead for 
Did you mean: 

redirect to SAP authentication window

Former Member
0 Kudos

Hi,

I’ve created an application that requires authentication (sap.authentication value true on application properties).

Initially, when the user starts the application, he has to login using a default authentication window provided by SAP.

How can I perform a logout and redirect to the default authentication window?

Thanks in advance,

Ricard.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Oscar,

Try this:


final IWDConfiguration cfg = WDConfiguration.getConfigurationByName
( 
  "sap.com/tc~wd~dispwda", "default"
);

WDClientUser.forceLogoffClientUser
( 
  cfg.getStringEntry("sap.logoffURL" ) 
);

VS

Former Member
0 Kudos

Hi Valery,

The logoff is performed, but the authentication window doesn’t appear (blank window).

Thanks,

Ricard.

Former Member
0 Kudos

Oscar,

What URL is shown in address bar?

I'm not sure whether or not correct configuration parameter was read from config... Could you debug your code and check to what URL redirect is perfmormed?

VS

Former Member
0 Kudos

Hi Valery,

When the user runs the app for first time the shown URL on the address bar is :

http://olivia:50000/logon/logonServlet?redirectURL=%2Fwebdynpro%2Fdispatcher%2Flocal%2FWSCC%2FWSCC%3...

When the user is logged in, the main window is shown and the URL is: http://olivia:50000/webdynpro/dispatcher/local/WSCC/WSCC?SAPtestId=24

Finally, when the user clicks on the logoff button your code is executed and, as a result, the URL is: webdynpro/resources/sap.com/tcwddispwda/global/logoff.htm. But the address bar remains with the same URL. (http://olivia:50000/webdynpro/dispatcher/local/WSCC/WSCC?SAPtestId=24).

Thanks a lot,

Ricard.

Former Member
0 Kudos

Oscar,

The code should be even simpler:

WDClientUser.forceLogoffClientUser(null);

Cut form doc:

<i>url - the URL of the page that is shown to the user after logoff was done. If the parameter is null, the redirect is done to the "LogoffURL" URL that can be specified in the application properties. If this URL is also not defined, a redirect to a Web Dynpro internal logoff page is done.</i>

So you may either accept default logoff-page (just text "Web Dynpro application terminated. Good bye!" or provide your own page via application properties).

Next, it is impossible to just log-off to auth screen. It is necessary to set as log-off URL some application that requires authentication also.

This way WD will first log-off user, then shows auth-screen and then login him again to the target application.

So try the following:

1. Use code with null URL, forget about WDConfiguration.

2. In NW IDE open your application properties, and add standard property "log-off URL", for example "/useradmin/userAdminServlet?userProfileView";

This works for me (first application may be either with or without auth). My environment is NW04s, but this should work on NW04 as well.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi Valery,

It works!

Thanks a lot,

Ricard.

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Valery,

your code can be replaced by one line:


WDClientUser.forceLogoffClientUser(null); 

See <a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/wd/com/sap/tc/webdynpro/services/sal/um/api/WDClientUser.html#forceLogoffClientUser(java.lang.String)">JavaDoc on class WDClientUser</a>:

<i>... 3.) Web Dynpro redirects to the specified URL. <b>If the specified URL is null, the redirect is done to the "LogoffURL" URL that can be specified in the application properties.</b> If this URL is also not defined, a redirect to a Web Dynpro internal logoff page is done."</i>

Regards, Bertram

Former Member
0 Kudos

I have a similar problem..i want to open the logoff page of the portal after doing WDClientUser.forceLogoffClientUser(null)......

I have set it in the application properties but it redirects to a Web Dynpro internal logoff page......

Anybody??

Answers (0)