cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict simultaneous login to a web dynpro application by the same user

Former Member
0 Kudos

I have a stand alone web dynpro application and used the sap.authentication for user to login into the application. How can i restrict a user from accessing the application from two different browsers using the same userid?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can try the following approach:

1. Create an outbound plug to some dummy view which shows the message to the user that he/she is already logged in. Let's call this plug "ToMessageView".

2. In the "wdDoInit" method of the component controller write the following code:


String loggedInUserID = WDClientUser.getLoggedInClientUser().getClientUserID();

String[] apps = WDServerState.getActualApplications(loggedInUserID);
//All entries of apps will look like <application-name>/<application-id>

boolean isRunningParallely = false;
	  
for (String app : apps) {
	if(app.split("/")[0].equals(wdComponentAPI.getApplication().getName())){
		isRunningParallely = true;
		break; 
	}
}
	  
if(isRunningParallely)
//fire the plug to message view here

FYI, I haven't tested this but do try it out.

Regards,

Satyajit

Former Member
0 Kudos

I have created a messageView and an inbound plug for it. How do I create a outbound plug from the component controller to this messageView

Former Member
0 Kudos

WDServerState is not supported from NW07 onwards. Is there an alternative for it? I am using NW7.1