How to set userName from security context to Criteria in portlet

Hi,
From the portal application I have to get the logged in user and use the same user to filter the records in Portlet. I have to execute a view Criteria in portlet as a default method activity which takes logged in user as a input param.
Is this achievable? Please let me know.
Thanks in Advance
Morgan.
Edited by: Morgan Freeman on Aug 24, 2011 1:22 AM

I have been doing some testing and there seems to be an issue with passing username to the portlet.
Normally things like security.userName or portletrequest.getRemoteUser() should all work and they do work in webcenter PS2 but since JSR 286 this does not seem to work anymore.... ALthough the documentation of oracle states that is works but it doesn't :)
A working workaround is to create a public render parameter (portlet parameter) and pass the username to that.
I'll see if there is a configuration that we need to make in order for this to work.

Similar Messages

  • How to set username in securityContext??

    ADF Security uses SecurityContext to retrieve username and display page using roles of a particular user...... and we add users and application roles in jazn-data.xml
    Actually my website created in adf doesn't have any login page..... It will receive user information from another website....
    Now i want to display pages and their content based on user and their role....
    Can u please tell me how to set Username in securityContext such that my website will work on the username retrieved from another website via token....
    Please answer this question.....

    This may help...
    public String doLogin() {
    String un = _username;
    byte[] pw = _password.getBytes();
    FacesContext ctx = FacesContext.getCurrentInstance();
    HttpServletRequest request =
    (HttpServletRequest)ctx.getExternalContext().getRequest();
    try {
    Subject subject =
    Authentication.login(new URLCallbackHandler(un, pw));
    weblogic.servlet.security.ServletAuthentication.runAs(subject,
    request);
    String loginUrl =
    "/adfAuthentication?success_url=/faces/DashBoard";
    HttpServletResponse response =
    (HttpServletResponse)ctx.getExternalContext().getResponse();
    sendForward(request, response, loginUrl);
    } catch (FailedLoginException fle) {
    FacesMessage msg =
    new FacesMessage(FacesMessage.SEVERITY_ERROR, "Incorrect Username or Password",
    "An incorrect Username or Password was specified");
    ctx.addMessage(null, msg);
    } catch (LoginException le) {private void reportUnexpectedLoginError(String errType, Exception e) {
            FacesMessage msg =
                new FacesMessage(FacesMessage.SEVERITY_ERROR, "Unexpected error during login",
                                 "Unexpected error during login (" + errType +
                                 "), please consult logs for detail");
            FacesContext.getCurrentInstance().addMessage(null, msg);
             e.printStackTrace();
    reportUnexpectedLoginError("LoginException", le);
    return null;3
    private void reportUnexpectedLoginError(String errType, Exception e) {
    FacesMessage msg =
    new FacesMessage(FacesMessage.SEVERITY_ERROR, "Unexpected error during login",
    "Unexpected error during login (" + errType +
    "), please consult logs for detail");
    FacesContext.getCurrentInstance().addMessage(null, msg);
    e.printStackTrace();
    Thanks,
    CM.

  • How to search data from a context node.

    Hi Friends,
    Thanks for ur help for previous problem . I am facing some other problem i.e how to
    search data from a context node.
    i have a context node :-
    Car(main node) which consist of details, owners, engine and Brand  as its sub node.
    the value attibutes of difft nodes are:-
    Car-  category
    Details-  Mileage, Price, registration_no, miles_used
    owner -  name, phnno,addrs
    Brand -  main_brand, co_brand
    Engine- Bhp,Rpm
    Now i have to apply a search criteria on the basis of price, miles_used .
    pls help to implement that .
    Thanks & regards
    Pravin jha

    Hi PRAVIN,
                       What I can understand from your problem is that, you have a list with various properties and you want to display them and search them in your WD App. If I am correct, use the following approach:
    Instead of using "details, owners, engine and Brand" Nodes, use the attributes inside the parent node. i.e in the node Car, add all the attributes viz. Mileage, Price, registration_no, miles_used, name, phnno,addr etc.
    Now you can create a table of this node "Car" and can easily search on the basis of any criteria.
    I hope this solves your issue. If you are looking for something else, please revert, I'll be happy to help you.
    Cheers!!!
    Umang

  • How to recover answer from security questions?

    how to recover answer from security questions?

    Hi there Chaleska,
    If you can't remember the answers to your security questions, you can use the steps outlined in the article below to reset those questions.
    If you forgot the answers to your Apple ID security questions
    http://support.apple.com/kb/HT6170
    -Griff W.

  • How to get username from customer email id.

    Hi experts,
    How to get username from customer email id.I am using transaction XD02.
    I would be thankful for your kind replies .
    Regards,
    Sachin Hada

    Hi sachin,
    Re: Email id field
    Regards,
    Sravanthi

  • How to pass Username from OWSM Security policy in Oracle Apps Adapter .jca file

    My BPEL process uses Oracle Applications Adapter. The following is the .jca file for the Adapter.  The Username is initialized statically to "sysadmin" when I created the Adapter.Is it possible to pass in the username from the OWSM Security policy for the username value below? If so how to do? I appreciate your response.
    <adapter-config name="EBSAdapter" adapter="Apps" wsdlLocation="../WSDLs/EBSAdapter.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory UIConnectionName="EBS1" location="eis/Apps/EBS1" UIConcurrentPgmName="" UIOracleAppType="DBOBJECT"/>
      <endpoint-interaction portType="EBSAdapter_ptt" operation="EBSAdapter">
        <interaction-spec className="oracle.tip.adapter.apps.AppsStoredProcedureInteractionSpec">
          <property name="SchemaName" value="APPS"/>
          <property name="PackageName" value="INTG"/>
          <property name="ProcedureName" value="GET_USER_PROFILE1"/>
          <property name="IRepInternalName" value="PLSQL:INTG:WEBCENTER_GET_USER_PROFILE1"/>
          <property name="Username" value="sysadmin"/>
          <property name="Responsibility" value="System Administrator"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>

    1. Go to Invoke activity
    2. Click on Properties tab.
    3. click Add
    4. Add this property "jca.apps.Username" and map it with either variable or expression.
    5. Populate variable defined at previous step with some valid username value at runtime.
    hope this helps.
    Regards,
    Karan
    Oracle Fusion Middleware Blog

  • How to set value from one view to other view's context node attr b4 save

    HI all,
    My requirement is as below:
    There are two views in component BP_CONT.
    BP_CONT/ContactDetails    IMPL class
    BP_CONT/SalesEmployee   SALESEMPLOYEE    STRUCT.SALESEMPLOYEE
    I want to set value from first view to second view's context node's attribute.
    i get Sales Employee BP number in ContactDetails view, from here i want to set that value in to STRUCT.SALESEMPLOYEE
    of second view in the same component.
    please send me code snippet for doing the same.
    Thanks in advance.
    seema

    Hi Seema
    You can access the fields from different views by either using custom controllers or by using component controllers, in your case you can access the Sales employee BP number from the Component controller.
    first access the component controller  as below in BP_CONT/SalesEmployee  (in do_prepare_output method) or in (specific setter method)
    lv_compcontroller type ref to CL_BP_CONT_BSPWDCOMPONENT_IMPL,
    lv_partner type ref to cl_crm_bol_entity,
    lv_role type string,
    lv_partner_no type string.
    lv_employee TYPE REF TO if_bol_bo_property_access,
    lv_compcontroller  = me->COMP_CONTROLLER.
    lv_partner ?= lv_compcontroller  ->typed_context->-partner->collection_wrapper->get_current( ).
    lv_role = lv_partner->get_property( iv_attr_name = 'BP_ROLE' )
    IF LV_ROLE = 'SALESEMPLOYEE'
      lv_partner_no ?= lv_current->get_property( iv_attr_name = 'BP_NUMBER' ).
    endif.
    now set the value
    lv_employee ?= me->typed_context->salesemployee->collection_wrapper->get_current( )
    CHECK lv_employee IS BOUND.
        lv_employee->set_property( iv_attr_name = 'SALESEMPLOYEE' iv_value =  lv_partner_no  )
    Thanks & Regards
    Raj

  • Using AX as wireless router, how to set up w/ security and airtunes on XP

    I previously had a Linksys wireless router. I just purchased an Airport express to use as the wireless router (and remove the Linksys router) as well as use the Airtunes functionality.
    After some trial and error, I have been able to wireless connect my computer to the AX on it's own (the linksys router is now unplugged and out of the equation). I can connect to the internet fine on my PC (XP Pro SP2).
    Trouble is, when I use the Network Setup Assistant, it shows the apple network listed, but it can't connect to it, no matter how many times I try, reboot my machine or reboot the AX. I've tried both the "setting up a new network" and "editing an existing network" option, and in each selection, after a few minutes of trying to connect to the network, I just get a failure message.
    If I try and use the Admin utility, nothing shows up in the left-hand list window, and when I Press re-scan, still nothing shows (it doesn't even appear to scan).
    I'm not sure what I'm doing wrong. I can't find simple instructions on how to set up the AX as the only wireless router for a PC and set up security and Airtunes (I'm assuming enabling airtunes is done in these applications, as I haven't seen anything about that yet either).
    Any ideas on how this is done with a PC? Much thanks!
    Dell 4500 series

    I have found the 'DHCP Reservations' option on the AirPort Extreme to be buggy.  I seem to remember it causing IP conflicts for some reason.  I think what I remember is that if the computer with the reservation was off, and the DHCP server then handed out that IP to another DHCP client, then there would be a conflict when the reserved IP computer was turned back on.  Maybe it was an issue in ealier versions of the AE or OS X as the case may be, and maybe it's been corrected, but I've never bothered using it agian since the method I describe below has always worked without fail.  Also, I'm guessing DHCP Reservations would work fine if one manually enters IPs outside of the DHCP range but in the AE 'DHCP Reservation Setup Assistant' the IP options provided are within the DHCP range which to me makes no sense and increases the potential for IP conflicts.
    Here's what I do to setup a mixed environment of static and dynamic IPs on my network.  It works like a charm and does not require the DHCP server (beyond the distribution of dynamic IPs to hosts using DHCP).
    For machines on my network that are accepting services from the public network, I set them up with static IPs using the 'Manually' option (System Preferences/Network/Ethernet/Configure IPv4).  The settings for 'Router' IP address and 'DNS Server' IP address should both be set with your gateway/router LAN IP).  Use an IP address below or above the DHCP range of adresses (in AE/Internet/DHCP/DHCP Beginning & Ending Address).
    i.e. if my subnet is 10.0.1.1 and my DHCP range is 10.0.1.100 to 10.0.1.150, you could set the static IPs on your local hosts as 10.0.1.x where x = any number from 2 - 99 or from 151 - 200 as an example.
    All other machines and devices that do not require static routing are setup as DHCP clients and get a dynamic IP from the AE.  To me it's a simpler setup though it might take a little extra time to setup initially.
    John

  • How to set username and password when using Proxy class for SOCKS5?

    Hi all,
    I use the proxy class for SOCKS5, so need to set username and password, I don't find where can I set the value. whether the API support it.
    Thanks in advance!

    System.getProperties().put("proxySet", "true");That does nothing. Remove.
    System.getProperties().put("proxyHost", getProxyHost());
    System.getProperties().put("proxyPort", getProxyPort());You should be setting socks.proxyHost and socks.proxyPort here.
    System.setProperty("java.net.socks.username", getSOCKSUsername());
    System.setProperty("java.net.socks.password", getSOCKSPassword());
    Authenticator.setDefault(new ProxyAuth(getSOCKSUsername(), getSOCKSPassword()));You either need the first two lines or the third, not both. See the last link posted above.
    1. After I set the value, I connect internet by proxy, how the proxy server knows the values?Because Java tells it during the SOCKS handshake.
    2. In my app, I just set the values in the system properties, then JVM does remaining work? Remaining work is not concerned?Should be OK unless you have to connect to a different SOCKS proxy from the same JVM, but that kind of thing is problematic anyway due to the curious Authenticator design which is set globally, not per connection as you might expect.

  • How to set songs from music as ringtones for contacts

    How do I set songs from my music that is on the phone as ringtones for different contacts?

    Songs and ringtones have different formats.  They are not interchangeable.  You would have to convert a song into a ringtone.
    If you have a Mac, you could use the GarageBand app to do that.  If you have a PC, there are apps to do the conversion, but I cannot name one.

  • How to Set "delete from hub and server" for each account

    How can I set "delete from hub and server" differently for each account?
    I have 3 emails (2 shared, 1 personal).
    the personal is a 'hotmail' account which has device set to 'sync email', 'push', and 'Use SSL'.
    it will only sync one way (from desktop to device).
    I cannot set the global setting on the device to "delete from Hub and server" without affecting all accounts.
    I do not want to have to confirm delete on every item.
    previous to the 10.3 update this was not an issue.
    am i missing something? or is this another step backwards?

    The only other way would be to set it to prompt every time you get an email. Yeah, I know that defeats the purpose.. I guess in this aspect it is a step back

  • How to set classpath from java class ??

    I have tried to use System.setProperty("java.class.path", "my class path string ") to set classpath dynamically. But it is not working. How to set it dynamically from java class ?? Thanks , gary

    Look into the java.net.URLClassLoader. You can't set the classpath after the fact but you can specify URL's that will checked when you try to load a class with that loader.

  • How to select username from v$logmnr_contents in oracle 10g

    Hi,
    Can anyone to provide solution for the below mentioned problem.
    I use
    select sql_redo,cscn,USERNAME from v$logmnr_contents where sql_redo is not null and operation_code in(1,2,3,7) and seg_type in(0,2) and (seg_owner is null or seg_owner not in('SYS','SYSMAN'));
    to select sql_redo,cscn and username from v$logmnr_contents.
    I got the sql_redo and cscn properly but username is listed sometimes blank. I need to select the username from v$logmnr to understand which user executes the sql. Please give me a solution immediately because now i am stucked with this problem.
    Thanks in advance

    Hi,
    Please use session_info in your query
    Also set this field in where clause to not be as 'UNKNOWN'.
    Regards
    Mona
    Edited by: mona mirbakhsh on Feb 27, 2010 5:23 AM

  • How to set username and password at line vty 0 4?

    hi guys,
    would like to know how i can set username and password so when i telnet to the router, i can login as username and password..?
    thks,
    ken

    Hi,
    for a simple telnet password with user name & password, find the steps below,
    aaa new-model
    username password
    line vty 0 4
    password
    login local
    if you wanted different types of users to login with different privilagez,do the following
    username privilege 15 password
    username privilege 5 password
    privilege exec level 15 conf t
    privilege exec level 5 show
    line vty 0 4
    password
    login local
    in the above statement "privilege exec level 15 "will have full access, "privilege exec level 5" will have the limited like "show" related
    hope this helps.
    rate this post if cleared.

  • How to set Dynamic value to context variable

    hi all
    Can anyone suggest me how to change value of context variable.
    In short i need to set dynamic value to context variable
    here is my code in web.xml
    *<context-param>*
    *<param-name>sessionTimeOutValue</param-name>*
    *<param-value>200</param-value>*
    *</context-param>*

    ChintanPatel wrote:
    here is my code in web.xml
    *<context-param>*
    *<param-name>sessionTimeOutValue</param-name>*
    *<param-value>200</param-value>*
    *</context-param>*You can set the session time using httpsession.setmaxinactiveinterval

Maybe you are looking for