on 10-31-2008 11:26 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
}
}
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.