cancel
Showing results for 
Search instead for 
Did you mean: 

logoff and redirect to the login page

Former Member
0 Kudos

Greetings

On a webdypro application I have to check if the user has to change his password, and if so then I execute the

mutableAccount.setPasswordChangeRequired(true);

After doing this I want to logoff the user and send him to the login page so he can change his password.

Im trying with

WDClientUser.forceLogoffClientUser(null);

but I want it to go the login page. Im thinking about send it to the Application Url, but I would like to have it on a dynamic way, with a webdynpro function so I wont to hard code it.

Thanks in advance for your help

Jean Carlo

Accepted Solutions (1)

Accepted Solutions (1)

pravesh_verma
Active Contributor
0 Kudos

Hi Jean,

I am sure that you would be getting a logon page initially when you are launching your application. Just check what is the URL generated for your application. It would be something like this:


http://<Server_name>:<port>/webdynpro/dispatcher/<pacage_name>/<application_package>~<project_name>/<application_name>?SAPtestId=0

So where you are using this line of code WDClientUser.forceLogoffClientUser(null); try this code:


WDClientUser.forceLogoffClientUser("/webdynpro/dispatcher/<pacage_name>/<application_package>~<project_name>/<application_name>");

Which means you have to replace the null with the complete path of you application whih is after the port.

I hope this will solve your problem. Please revert back in case you have any further issue.

Thanks and Regards,

Pravesh

Answers (4)

Answers (4)

Former Member
0 Kudos

I couldnt redirect to the password change page

Former Member
0 Kudos

thanks for your answer, It was helpfull

ok this is what happens now:

The user logon and then I check that he must change his password and getsredirected to the login page.

Then the user put his logon information and then its redirected to the password change page.

This makes the user see the login page twice, one after another

Is there a way to redirect the user to the password change page directly?

Former Member
0 Kudos

This seems to work


 try {
 WDDeployableObjectPart deployableObjectPart =wdComponentAPI.getApplication().getDeployableObjectPart();

 String urlToTargetApp =WDURLGenerator.getApplicationURL(deployableObjectPart);

 WDClientUser.forceLogoffClientUser(urlToTargetApp);
 wdComponentAPI.getMessageManager().reportSuccess("(IQX-urlToTargetApp:"+urlToTargetApp+")---");
 } catch (WDURLException e) {
...
 } catch (WDDeploymentException ex) {
...
 }

Former Member
0 Kudos

Is there a way of getting the generated Url of the application?

the project its gonna be on several servers and I rather getting it from a WD function

thanks

pravesh_verma
Active Contributor
0 Kudos

Hi Jean,

Why do you exactly want that code for getting the application URL. You just need the path after the server location so you will never require the information regarding the servers.

No matter where you deploy this application, you will still be able to logoff from the applicationand return to the initial page.

I hope this solve the issue. Kindly revert back in case the issue is not resolved. Please close the thread and grant points if suggestion was helpful..

Thanks and Regards,

Pravesh