Retrieve portal user
Hi,
can somebody help me. I want at starting of a WD application. That it retreives the portal user as in input of the bapi. Is there a tutorial or can somebody explain me what code i need to use or ahat i need to do
Regards
Hi,
Let's say that you are doing the username retrieval part in the custom controller. So create a value attribute say, UserName in the custom controller's context. Also create a value attribute of the same name in the view controller's context under the value node that is boind to the datasource property of the table and map the custom controller attribute to the view controller's attribute. The view context might look like:
-Root
--TableDataNode
---UserName
---... (other nodes)
Once you have fetched the user name in the custom controller, use a code like:
wdContext.currentContextElement().setUserName(userNameStr);
Now in your view, create a table column to show the user name. Insert a textview as the cell editor and bind the
text property to, TableData.UserName.
Regards,
Satyajit.
Similar Messages
-
Hi,all
In NW 2004 I retrieved the user name of portal user by following:
HttpServletRequest req =((com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter ()).getHttpServletRequest();
wdContext.currentContextElement().setUserName(req.getRemoteUser());
But in NW 2004S it is not working.I can not to locate IWebContextAdapter.
How can I retrieve the portal user name here?
Regards,
MichaelHi,
Please try following code and let me know.
import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
try
//get the currently logged in user
IWDClientUser wdUser = WDClientUser.getCurrentUser();
//get the com.sap.security.api.Iuser; It is null in case wdUser represents an anonymous user
IUser user = wdUser.getSAPUser();
//check whether the user is anonymous
if (user != null)
//access logon ID by iterating through the IUserAccount array
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
String strUserid = acct[0].getLogonUid();
wdContext.currentContextElement().setId(strUserid);
//pass the value obtained from the portal to value attribute
catch (Exception e)
wdComponentAPI.getMessageManager().reportException("Failed to get current user: " + e.getLocalizedMessage(), true);
Regards,
Vaibhav -
Retrieve Portal User ID in WD ABAP Application
Hi ,
i have to make an Iview which calls WebDynABAP application and give me output that who has logged into Portal .problem is how to pick the user id from the portal ,i have logged in and how to use that in my WebDynABAP application.is there any function which import or give u that user id and i can store it and display it.
Regards
GovindHi Govind Turka,
have a look at this thread
[WD4A: pass portal logged in userID to WebDynpro ABAP IView.|WD4A: pass portal logged in userID to WebDynpro ABAP IView.]
or you can create a FM in ABAP and get the SY-UNAME and in the application wherever you want you can call that method and get the SY-UNAME.
Hope this helps.
Cheers-
Pramod -
How to fetch Portal Users data ? (Including Mapping details)
Hi all,
I want to retrieve Portal users data with the detail of its mapping (i.e. if the user is mapped or not with backend user? and if yes, to which backend user?).
Thanks,
TejasThanks for the reply Nadav.
But what I want is the complete list of all the users, the reason being there are more than 2000 users on Portal and going for this one by one mapping checking is not really feasible time and effort wise.
So is there any way how can I get the users data from UME or LDAP? as I have both kinds of users.
Please guide.
Thanks and Regards.
Tejas -
Retrieving a portal users list once connected to Apex 1.6 ?
Hi,
We connect to Apex through a Portal SSO connexion. Once connected, we use the wwv_flow_ldap.is_member function to show or hide certain pages to some users. I now need to create a lov which would retrieve all users of a certain Portal group. Is there an api or a fonction to do that ?
ThanksYes there are several group functions and procedures provided in the wwsec_api. This link here
http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1014/index.html
explains more about them. Although the wwsec_api.person_info function returns a wwsec_person%ROWTYPE and there is a default_group column, not sure what this is used for but you could try using that?
Hope this helps.
Danny -
UNABLE TO RETRIEVE THE CLIENT IP ADDRESS AND HOST NAME OF A PORTAL USER
I'm trying to retrive the client IP address and host name of a portal user
trying to access a portal page using APIs:
PortletRenderRequest portletRequest =
(PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
HttpServletRequest servletRequest =
(HttpServletRequest)portletRequest.getAttribute(HttpCommonConstants.SERVLET_REQUEST);
String l_szClientIPAddress = servletRequest.getRemoteAddr();
String l_szClientHost = servletRequest.getRemoteHost();
but i found that for all portal users on different machines IP addresses, the
returned IP is the same for all which is Portal middle tier IP address.
So how can retrive the IP addess of a portal user trying to access a portal
page ?Brijesh,
Do you mean how to see hostname/ip address of client requests processed by the server? If yes, depending on what's your front ending component - Web Cache or OHS, you can configure the access log format to have this information recorded in either of these component's access log file.
For Web Cache access log file, refer this:
http://download.oracle.com/docs/cd/B14099_19/caching.1012/b14046/diagnostics.htm#sthref2090
For OHS access log file, refer this:
http://download.oracle.com/docs/cd/B14099_19/web.1012/b14007/servlog.htm#sthref439
By default, both Web Cache and OHS are configured to use Common Log Format (CLF) that does record hostname/ip address so if you haven't made any changes to log format, this info is already there for you. Look for $ORACLE_HOME/webcache/logs/access_log file for Web Cache and $ORACLE_HOME/Apache/Apache/logs/access_log file for OHS.
Thanks
Shail -
How to get Portal User Context in Web Dynpro application
I have successfully integrate a web dynpro app into SAP Netweaver Portal.
Within my web dynpro app, how can I get portal user context information such as first name, last name, job title or some newly created ume attibutes.
Is there any programmatical approach to get portal user context in my web dynpro. I not sure whether I can use the following codes in web dynpro?
IUserContext userContext = request.getUser();
String firstName = userContext.getFirstName();
String lastName = userContext.getLastName();
If yes, can someone point me the name of the jar file I have to import.
Note : The SAP Netweaver installation that runs my web dynpro app is same with the SAP Portal.Hi ,
you can use the below code to get User details and add com.sap.security_2.0.0 > lib > com.sap.security.api.jar
try
IWDClientUser clientUser = WDClientUser.getCurrentUser();
String firstName = clientUser.getFirstName();
String lastname = clientUser.getLastName();
catch (WDUMException e) {
wdComponentAPI.getMessageManager().reportException("Error Retrieving User"+e.toString(),true);
Regards,
Sunitha Hari -
How to get Portal user from a standalone Java application
Hi,
I have a standalone Java application from where I need to fetch the Portal User Information like userid and email id.
I am using the below line of code
iUser = UMFactory.getUserFactory().getUserByLogonID("e017939");
I have included the jar file com.sap.security.api , But it was giving me the below exception
java.lang.NoClassDefFoundError: com/sap/tc/logging/Location
at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:55)
at com.am.wcas.java.mailscheduler.kmaccess.FetchDataFromKM.getiUser(FetchDataFromKM.java:29)
at com.am.ScheduleEmails.main(ScheduleEmails.java:89)
and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
Then I went throught he SDN threads and they asked me to include the
logging.jar and com.sap.security.perm.api .
I Included them, then also, it is giving me Exception
java.lang.NoClassDefFoundError: com/sap/engine/lib/logging/LoggingHelper
at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:56)
at com.am.FetchKMData.main(FetchKMData.java:30)
Exception in thread "main"
and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
Kindly let me know if it is possible to access the User info using UMFactory in a standalone Java application. If yes kindly let me know where i am going wrong.
Regards,
Shilpa B.VHi Shilpa,
1. Check that you have added com.sap.security.api within the Your Project>Libraries folder (under navigation tab) and also added jars in the build path of the Your Project under project>properties>Build Path.
2. In case you have a DC instead of Web Dynpro Project then you have to add the com.sap.security.api under Your DC>Used DCs and have compile time and runtime dependency added.
Here java.lang.NoClassDefFoundError is caused basically due to only build time dependency added and reference to the jar missing at runtime. Rest the code to retrieve the current user id using UME API and getUserByLogOnID("....") method with/without portal environment would not be an issue at all.
Regards,
Tushar SInha -
Import not authenticating portal user
I am using Portal 10.1.4 and am trying to import a portal from another Portal 10.1.4 instance. I have retrieved the import/export script from the web interface from the source system (in Navigator when selecting Export for the relevant Page Group).
However, no matter what portal user and portal password I put on the command line, I am getting an authentication error:
D:\>export107.bat -mode IMPORT -d export107.dump -c ORCL -s PORTAL -p <schema password> -company MyCompany -pu portal -pp <portalpassword>
Verifying the environment variables...
Verifying the Oracle Client version...
IMPORT Mode Selected
Verifying the portal schema passed...
Verifying the availability of transport set...
Verifying the status of transport set...
Calling Oracle exp or imp utility based on the mode of operation....
PL/SQL procedure successfully completed.
Checking for privileges...
Checking for version compatibility...
Setting the Context...
Error: Authentication failed for portal
Cannot proceed with Import
I have checked that the portal user is in the OID and that they have a portal profile (using the Portal Admin web interface).
How do I properly set up a user which can be used in the import script? (i.e. the pu and pp command parameters)?
ThanksThe problem turned out to be an incorrect value for the company parameter. I think this is what was suggested above - and it works. Just use the default value for company when executing the import script
-
Userid of a Portal-user in Web Dynpro ABAP
Dear colleagues,
we want to migrate our application from BSP to Web Dynpro ABAP and I'm looking for a procedure how I can get the userid of a Portal-user in Web Dynpro ABAP which is running inside an iView ?
In BSP I used iView application parameter user_id and in the BSP the event handler for data retrieval with:
userid = runtime->server->request->get_form_field( 'userid' ).
Found a lot of entries how to do it in Java but no one for WDA ?
Thanks in advance
MichaelHi Michael,
Actualy it is not so trivial. You have some options:
1) In case user_id is parameter of iView you can read URL parameter like described here Webdynpro ABAP url-parameters
2) In case user_id is not iView parameter you can use usuall ABAP <i>sy-uname</i> system variable.
But pay attantion that it is not really EP user. Here we have 2 options: user mapping and SSO. In case of user mapping <i>sy-uname</i> will contain R/3 user which is mapped to EP user. In case of SSO <i>sy-uname</i> will contain same user name like in EP, because by using SSO user must ne the same on issuing and accepting systems.
Best regards, Maksim Rashchynski. -
Error when editing Portal User Profiles
Hi there,
I got this error message when editing Portal User Profiles
Error: The specified user does not exist. (WWC-41406).
I can select users from OID, but can't edit them.
Note: these users are imported from AD and placed in a different OU other than users container in OID.
But, If I create a user in the same OU from Portal Administration page, then I can select and edit that user's Portal Profile.
So what's the difference between imported users and the user created from Portal?
Please advise.
Thanks,
GeoffREPORTSDEV was an invalid user so we dropped this user and started over and now it works.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by GREGG SAKSEFSKI ([email protected]):
I'm tring to edit user REPORTSDEV.
So I'm on the "Administer" tab and enter "REPORSDEV" in the User box and press <EDIT> button.
After a couple minuates I receive the error below:
Error: Unexpected error encountered in wwsec_api.id_sso (User-Defined Exception) (WWC-41417)
The system failed to retrieve the necessary HTTP request to the Login Server to validate this user. (WWC-41447)
Any ideas???<HR></BLOCKQUOTE>
null -
Count total number of existing Portal users..Urgent
Hello All,
im working on EP6 SP9 (and SP12).
I would appreciate if anyone would please guide me - How can I retrieve total number of existing Portal users (<b>using code</b> & not Activity Reporting).
This is kinda urgent....please I request you all.
Thanks in Advance.
Warm Regards,
Ritu R HUnjanHi ritu,
Check this code. This will give you the total no of users and the names of all the users:
package com.hcl;
import com.sap.security.api.ISearchResult;
import com.sap.security.api.IUser;
import com.sap.security.api.IUserFactory;
import com.sap.security.api.IUserSearchFilter;
import com.sap.security.api.UMFactory;
import com.sapportals.portal.prt.component.AbstractPortalComponent;
import com.sapportals.portal.prt.component.IPortalComponentRequest;
import com.sapportals.portal.prt.component.IPortalComponentResponse;
public class PortalUsers extends AbstractPortalComponent
public void doContent(
IPortalComponentRequest request,
IPortalComponentResponse response)
try
IUserFactory userfactory = UMFactory.getUserFactory();
IUserSearchFilter userfltr = userfactory.getUserSearchFilter();
userfltr.setMaxSearchResultSize(5000);
ISearchResult userResult = userfactory.searchUsers(userfltr);
int size = userResult.size();
response.write("<table><tr><td bgcolor=Green>"+ "Names of the user are:"+ "</td></tr></table>n");
while (userResult.hasNext())
response.write("<table border=0>n");
String uniqueid = (String) userResult.next();
IUser user = userfactory.getUser(uniqueid);
response.write("<tr><td>"+ user.getDisplayName()+ "</td></tr>n");
response.write("</table>n");
response.write("<table border=0><tr><td bgcolor=Green>"+ " Total no of users "+ "</td></tr>n");
response.write("<tr><td bgcolor=Red>"+ size+ "</td></tr></table>n");
catch (Exception e)
I hope this solves your problem
Regards
Pravesh
PS: Please reward points if answer is helpful. -
Portal User navigation report?
Hi, i'm just newbie at Oracle Portal and i need to get a user navigation statistical report. The company just like to know which ones of portal users are using this one.
Does anybody knows a way to do this?, does oracle have any tool for doing it?.
Regards,Hi Florian,
You can have a look at Metalink Note : 218911.1 - How to Retrieve the SSO Username in Reports.
You just need to have a User Parameter named "AUTHID" in your Report to access the SSO UserName. Your Reports need to be " SSO Enabled " for this to work.
Regards,
Sandeep -
HI
I need to develop a web dynpro application which gives the details of the portal user details who logs into portal
Can anyone provide me the code how to fetch the details of the users who logs into portal
thanks in advanceHi,
Make sure that your WebDynpro Applications Authentication property is set to True.
To get Portal User Details you can use the following UME Api's
try
IWDClientUser user = WDClientUser.getLoggedInClientUser();
IUser loggedInUser = user.getSAPUser();
catch(UMException ume)
//do something
this Iuser objects holds all the Properties of Portal User Except its Password.
and You can retrieve it like this
loggedInUser.getFullName();
if you know the Logon id of Portal User you can Also get the IUser object like this:--
IUser user = UMFactory.getUserByLogonId("Administrator");
To use UME APIS in Webdynpro you have to refer com.sap.security.api.jar in the Build path of your WebDynpro Application.
If You Are Using NWDI then you have to use the com.sap.security.api.sda lib Dc available in NWDI for Compilation in WD DC
Hope this Help.
Regards,
Siddharth -
Retrieve Logon user from Windows Directory
Hi,
We need to retrieve logon user from windows directory in BSP. Please suggest the relevant code for the same.
Regards,
DivyanshuHi,
I have a scenario where in we have a enhancement to open a PDF file in portal with standard SAP HCM_LEARNING application. If file does not exist then I need to give the custom messages.To give the custom message we need to check that whether the URL of PDF file is valid or not. Currently I am using HTTP2_GET function module to validate the same.This FM returns the status code by which we can know whether this URL is accessible or not. This function module requires a RFC destination as a input parameter . I am using SAPHTTPA for the same.
This RFC Destination (TCP/IP) does not have credentials with it , so the return status code is always 401 (unauthorised ). I also tried to use other RFC destinations(of type G) that have credentials with it but this is not compatible with this FM.
Can you help me in regard to below queries:
Is there any other method that we can use to validate the URL ?
How we can use the session variables (as the user has already logged in so that it should not ask for credentials.) Is there any way to specify the Credentials in the RFC destination of type T?
Kindly share your inputs with me to fix the same.
Maybe you are looking for
-
How do I search for a particular text and find the number of occurence of this text in a text file?
-
Can any one tell me how to make a join in between RESB & VBAP Table
Hi. can any one tell me how to make a join in between RESB & VBAP Table. Please do the needful.
-
Hello guys, I'm using AS3 and I have a problem with classes. I'll try to do my best to describe my situation. I'm building a dynamic website. I have main.fla and its document class is set to Main.as. Main class calls few other classes (Menu, Header e
-
elements 12 is suddenly asking me to sign in to my adobe account before using it. it has never done this before. it is NOT a trial version. what's going on?
-
Single document release - License type
Dear all, We are facing an issue, when rechecking the old import documents which are assigned with License (Created with license type - single document release) are getting legal control block now. The license is not getting recognized for the docume