on 04-04-2005 2:03 PM
Hello,
How do I take the current user credentials (meaning his username and password)? I know how to retreive his first name, last name ect... using wdClientUser.getCurrentUser(), but there is no option there to receive the user's parameters which serves him to enter the portal...
Hi,
I had the same problem .As a workaround you can try this
try{
user = WDClientUser.getCurrentUser();
IUser userID = user.getSAPUser();
wdContext.currentContextElement().setINumber(userID.getUniqueID().substring(userID.getUniqueID().length()-7,userID.getUniqueID().length()));
}
catch(Exception ex)
{
/* Exception Handling */
}
NOTE ::This is not the standard way of doing
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Thanx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ all,
I need the user credentials as well. And I tried this code:
<b>
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
</b>
But my developer studio doesn't find the <b>getSAPUser()</b> method.
Does anyone have an idea why I doesn't have it.
I have NDS SP11.
I got this two errors:
This compilation unit indirectly references the missing type com.sap.security.api.IUser (typically some required class file is referencing a type outside the classpath) MainBLComp.java art/gen_wdp/packages/com/ar line 0
-
The project was not built since its classpath is incomplete. Cannot find the class file for com.sap.security.api.IUser. Fix the classpath then try rebuilding this project. AR_Tool
Regards,
Dennis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you seriously asking for a mechanism to retrieve a user's password ...? (in ABAP: SY-PASSWD²)
As already outlined in the password is supposed to be a private information ("secret") known only to the user. The user is not supposed to share this secret with other users - and the system is supposed to handle this data with care as well.
I guess that you intend to submit a request to another server and wish that this request is processed under the userID of the current user (system acting on behalf of the user). Well, that's a typical scenario where "authentication assertions" should be used. That can be either SAML or the SAP proprietary version ("SAP Authentication Assertion Ticket").
Regards, Wolfgang
-
-
² that's a joke, such a system variable does not exist
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are your portal instance and webdynpro app running on the same WAS server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi just try this
WDClientUser.getLoggedInClientUser()
Thanks
Krishna Kanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try {
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
if (user != null)
{
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
String strUserid = acct[0].getLogonUid();
wdContext.current<input>Element().setAssoid(new String(<Userid>));
}
}
}
So how do I do it when I am running a dynpro application? Are you saying that a DynPro application cannot know these details? Do note that I am not running it from the NWDS test and preview(at this case I can understan why it gives null, since I am not inside the portal), I am running it from an iView while I'm inside the portal and I still receive null.
Hi,
I don't know what the problem is, however the code works fine for me. May be there is some configurations that you have missed out.
I'll tell you what i have done.
I've used the code in the init of the webdynpro and embedded the application in an iview . I assigned it to a role and the username is displayed in the application.
Regards
Noufal
Hi Roy,
Is ur portal and WAS using the same user store.
Any way try this code which works fine for me.
IWDClientUser clientUser = WDClientUser.forceLoggedInClientUser();
IUser user=clientUser.getSAPUser();
String userID=user.getUniqueID();
String id= userID.substring((userID.indexOf(":")+1));
Hope this should solve ur problem.
Regards,
Sowjanya.
try {
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
if (user != null)
{
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
String strUserid = acct[0].getLogonUid();
<b>boolean pass=acct[0].checkPassword(<String>);</b>
wdComponentAPI.getMessageManager().reportSuccess(strUserid);
}
else{
wdComponentAPI.getMessageManager().reportSuccess("no value retrieved");
}
}
else{
wdComponentAPI.getMessageManager().reportSuccess("no value retrieved");
}
}catch(Exception e){
wdComponentAPI.getMessageManager().reportSuccess("no value retrieved "+ e.toString());
}
Hello All,
Do forgive my novice question here but I am also currently encountering similar difficulties in obtaining the userid from Poratls. I have followed Noufal's code snippets and the WD app was deployed successfully. However, All I got back was a message "No value retrieved". According to the code, thsi probably means that the user equals to null. My WD app is embedded in an iview and is lauched from Portals. Does anyone know what else I must do to have my userid/login info displayed ? Eg: Parameters settings on the WAS or Portals ?
Thank you.
from
Kwok Wei
Hey Kwok,
Please check if your portal is configured with a proxy.
You can check that under: System Administration->System Configuration->Service Configuration. Search there for a portal service by the name "proxy".
After it found it, right-click on it and choose "configure".
In case your portal is configured with a proxy the fields "HTTP Proxy Host" and "HTTP Proxy Port" are filled.
In that case verify that the field "HTTP - Bypass Proxy Servers" is also filled. If it is not filled fill it like this:
<portalhost> | localhost | <portalhost fully qualified name>.
Save the changes and restart the Service. In order to restart it:
right-click again on "proxy" and choose "Locate in portal catalog". Once it found it, go to it's containing folder "com.sap...", right-click on it and choose "Administrate". there you can restart the services.
Let me know if it helped in any way.
Regards,
Roy
Hey Roy... It works now !!!
I am able to display my login ID after I set the "authentication=true". However, One thing that I have noticed is that it actually prompts me for a logon screen prior to lauching my web dynpro app. This looks like some parameter settings are needed on the WAS end. Can you advise ?
from
Kwok Wei
It does that because you launch the app from the NWDS which is outside the Portal. When you will build an iView based on this app inside the portal it won't ask you for login anymore since it will run inside the portal context, after the user made his login already....
If you need more help tell me.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.