cancel
Showing results for 
Search instead for 
Did you mean: 

Web dynpro as standalone

Former Member
0 Kudos

Hi,

I need to develop a standalone web dynpro application without portal.

What are the options available for User management as in roles and groups.

I need to customise my application based on user sttributes (ypically can be controlled via grps and roles in portal).....How can I do this in standalone wdj applications.

Thanks

Ashok

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Ashok,

If there is No Portal at all then it we need to do programitical approach there is no Delarative Approach for this that is there are no ACL's . We need to use -

The "com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser" provides access to both anonymous and authenticated userd. The class is a wraper around the UME's com.sap.security.IUser.

Before the user performs An Action we need to check for the Role of the user using the IWDClientUser which provides access to the IUSER which is a Standard UME attribute.

IWDClientUser user = WDClientUser.getCurrentUser();

IUser iuser - user.getSAPUser();

This IUser inteface provides all the access to need full.

Thanks and Regards,

Raju Bonagiri

Former Member
0 Kudos

Hi,

Say I have portal where I running on a different WAS and I integrate my WDJ iview and control authorisation using roles and groups on portal...

Can you tell me the code or the way in WDJ to read the PORTAL role names...

Also the code to read the roles that user has locally on web dynpor server..(I mean the UME roles...)

Many Thanks in advance,

Ashok

Former Member
0 Kudos

Hi Ashok,

You can get the Roles of the logged in user by the following Code. Make sure tou add com.sap.security.api for accessing UME.

IUser user;

try{

IWDClientUser user1 = WDClientUser.getCurrentUser();

IUser iuser - user1.getSAPUser();sss

Iterator rit = iuser.getRoles(true);

if(rit.hasNext())

{

IRoleFactory rfact = UMFactory.getRoleFactory();

while(rit.hasNext())

{

String rolname = (String)rit.next();

IRole role = null;

try

{

role = rfact.getRole(rolname);

response.write("Displayname:"role.getDisplayName()"<br>");

response.write("Description:"role.getDescription()"<br>");

response.write("UniqueId:"role.getUniqueID()"<br>");

response.write("Uniquename:"role.getUniqueName()"<br>");

}

catch (Exception e) {

response.write(e.getLocalizedMessage());

}

}

}

}

catch (Exception e) {

// TODO: handle exception

}

}

Former Member
0 Kudos

Hi Raju,

I guess this would return roles where the web dynpor runs..

I have web dynpro and portal running on two different WAS who have their own ume and datastore...

Is their a way to get the portal roles and groups from within the web dynpro code running in different instance...

Ashok

Former Member
0 Kudos

Hi,

Anyone?

How to get the portal user id in web dynpro given that portal and web dynpro are running on two different WAS instances..

(both have their own ume datastore)

Ashok

former_member192434
Active Contributor
0 Kudos

Hi

use this code to get it

Aslo you need to add security_2.0.0.jar file into java build path

java Build path> Add Varibales>WD Runtime>Extend>com.sap.tc.security_2.0.0

//@@begin LoginUser()

String LogonID;

try{

// create an user object from the current user

IWDClientUser wdUser=WDClientUser.getCurrentUser();

IUser user=wdUser.getSAPUser();

//LogonID=user.getUniqueName();

wdComponentAPI.getMessageManager().reportSuccess(user.getFirstName()" "user.getLastName().toUpperCase());

//wdComponentAPI.getMessageManager().reportSuccess(LogonID.toUpperCase());

wdComponentAPI.getMessageManager().reportSuccess("Logon User ID : "+wdUser.getClientUserID().toUpperCase());

}catch(Exception e){

e.printStackTrace();

}

//@@end

Thanks

Former Member
0 Kudos

Hi,

I think you can achieve this by retriving the username and password of portal in webdynpro java. Have a look on the following thread

[;

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5243] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9670] [original link is broken] [original link is broken] [original link is broken];

Regards

Raghu

Former Member
0 Kudos

Hi

As I said their is no portal at all..

Ashok

Former Member
0 Kudos

Hi,

Sorry for the above links i thought you want autentication of portal users but I am not sure about webdynpro security and authentication, but i think you can have workaround on UME and LDAP services

[http://help.sap.com/saphelp_nw04/helpdata/en/f5/4dd9d47a200d46bd1c56062f49e10b/frameset.htm]

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1031cf90-0201-0010-1ea5-b27218821417]

[;

[;

Regards

Raghu