How to forward action based on user logged in ?

Hi All,
Jdev Ver : 11.1.1.4.0
I am using Adf security, with form based authentication..
I have written login action in managed bean , and forwarding page using the based on url.
    public String doLogin() {
        String un = _username;
        byte[] pw = _password.getBytes();
        FacesContext ctx = FacesContext.getCurrentInstance();
        HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
      String loginUrl = null;
        try {
            Subject subject = Authentication.login(new URLCallbackHandler(un, pw));
            weblogic.servlet.security.ServletAuthentication.runAs(subject, request);
            SecurityContext sec = ADFContext.getCurrent().getSecurityContext();
            System.out.println("Profile :: "+sec.getUserProfile());
            System.out.println(sec.getUserName());
            System.out.println(sec.getUserPrincipal());
            for(String role : sec.getUserRoles()){
              System.out.println("Roles :: "+role);
            System.out.println(JSFUtils.resolveExpression("#{securityContext.userName}"));
            if(un.equals("john.doe")){
              //loginUrl="main";
              loginUrl = "/adfAuthentication?success_url=/faces/main";
            }else{
              //loginUrl="test";
              loginUrl = "/adfAuthentication?success_url=/faces/test";
           // loginUrl = "test";//"/adfAuthentication?success_url=/faces/main";
            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) {
            reportUnexpectedLoginError("LoginException", le);
        return null;
    }Now i want to return some action, not using the URL. and sendforward
any suggestions please ?
thanks
Gopinath

The application is created without configuring the security, later at the end we are doing the security configuration.
I used formbased authentication , there are 3 roles for the users, based on the users after login action i need to show the screen.(no common screen, each screen is different for each users,)
I used executeWithParams for executing some VO's before the page loads, if i use the two or more outcome actions in login action, its not rendering the corresponding page and it remains in the same page.
in between i have to check for user in roles , so based on that i have to set the outcome. find my above login action code.
This is my use case, tell me suggestions and any idea please.
thanks
Gopinath

Similar Messages

  • How to show pages based on user logged in adf security ?

    Hi All,
    JDev ver : 11.1.1.4.0
    I have three Roles MANAGERS, ADMIN, ANALYST with users in each role.
    And i used form based authentication. There are seperate screens for each user, i want to show according to the user entered with Roles.
    How to Configure these roles in Resource Grants and what should be done in login action..
    For me the page now going forward, it remains in the login page itself
    How to do that ?
    thanks,
    Gopinath

    Hi..
    try out following sample
    http://andrejusb.blogspot.com/2011/05/oracle-webcenter-11g-ps3-adf-security.htmlalso check this >http://andrejusb.blogspot.com/2009/01/practical-adf-security-deployment-on.html

  • Showing/Hiding Dashboard Prompts dynamically based on User logged on

    Hi
    I have query reg a showing/hiding dashboard prompts based on Users logged in.
    What is the best way???
    Please help
    And also anothe quick question
    Is there a way that we can change the Label of Dashboard prompt "ABC" for few users and "DEF" for other users
    Thanks in advance
    Cheers

    Hello,
    Using guided navigation properties for section, we can achieve your first requirement.
    How many prompts to be shown?
    depends on that number, you have to create those many reports in answers like,
    take one column to criteria and change functionaityt to case when 1=0 then Markets. Region else user() end
    apply filter on this equals to UserA (for userA), say ReportA
    for UserB filter has to change to UserB, say ReportB...etc
    Now, add all the prompts to dashboard, but each section (dashboard object) for each prompt.
    Go to section properties of each and select guided navigation property. The section which is holding the PromptA (should be shown to userA) then browse the reportA for guided navigation and click ok
    LIke this do for all prompts.
    Hope you understood...
    if any queries ask me..
    And for 2nd Q, in prompt, you have Select captio option which is the last option for all prompts,
    Write something there and check

  • How can I set a specific user log on neme to a specific machine

    Greeting,
    I have a question : 
    How can I set a specific user log on name to a specific machine.
    e.g. 
    Only User.A can log on to PC.A and the other can not.
    Base On :
    Windows Server 2003
    Active Directory Version : 5.2.3790.1812

    Technically we're both right.  This depends on what scenario you're setting this up.
    1)  If you want to say only this person can log on to this machine, and it's not an enterprise solution (meaning you have a handful of computers you want restricted, not all computers) then do something like Yan Li has recommended.  However, I
    do not recommend using any DENY LOCAL LOGON user rights.  In this case, you would have to deny everyone except 'User A' and your Administrators.  If you put a user in ALLOW LOCAL LOGON and DENY LOCAL LOGON, then DENY wins and no one logs in.  Instead,
    you should remove all the settings from ALLOW LOCAL LOGON and add only User A and administrators.
    2) If this is an enterprise solution, use the LOG ON TO option I mentioned before.  Managing user right assignments per machine is very difficult and isn't a practical way to do it on a large scale.  If every user in your domain is assigned a computer
    that they can use, only that user can use that machine and that machine will effectively only allow that user.  For this to work, EVERY user must be restricted to a workstation, if no setting is present, then that user can log on anywhere.  This
    is my preferred solution still.
    Like I said, it depends on your situation to which route is better.  I hope this helps and is clear and easy to understand.
    - If you have my posts to be helpful, or the answer, please mark them appropriately.  Thank you.
    Chris Ream

  • How to backup files from other user logged in as administrator

    RE: How to backup files from other user logged in as administrator AND/OR how to repair drive with "Invalid catalog PEOF"
    Hello,
    My MacBook Pro computer’s hard drive is not booting.
    I booted with the base operating system and ran Disk utilities and I got the following messages:
        Invalid catalog PEOF
        The volume could not be verified completely.
        This disk needs to be repaired.
        Disk utility can’t repair this disk. Backup as many files as possible, reformat the disk,
        and restore your backed-up files.
    The problem is that I have a couple of USERS set up on this computer, and it won’t let me backup the files of the second user.  The folders are locked and I can’t access them, even though I am logged in as the administrator.
    I made a boot disk on my other computer ( a MacPro Early 2008 ) desktop computer with the DiskWarrior 4.4 updater,
    but it won’t boot on my MacBook Pro.
    How can I backup these user files so that I can copy them back once I fix the drive?
    or better yet,  How can I repair the Invalid catalog PEOF on this drive?
    Thank you in advance for your time! 
    Bill
    THIS IS THE COMPUTER
    ================
    17” MacBook Pro 2.8GHZ 4GB Ram (purchased in 2009).
    Model: A1297
    Running Mac OSX 10.9.5

    Try using Disk Utility/Restore to copy the backup to a new location. Please note that this will reformat the destination partition which will erase all data.
    Do a backup. Boot to the Recovery Volume (command - R on a restart or hold down the option/alt key during a restart and select Recovery Volume). Run Disk Utility Verify/Repair and Repair Permissions until you get no errors.  Reformat the drive using Disk Utility/Erase Mac OS Extended (Journaled), then click the Option button and select GUID. Then re-install the OS.
    OS X Recovery
    OS X Recovery (2)
    When you reboot, use Setup Assistant to restore your data.

  • How to disable chanllenging questions while user log in for first time

    Hi All,
    How to disable challenging questions while user log in for first time in OIM 10g and OIM 11g
    also i need to know how to change the Oracle logo with custom logo in both versions

    In 11G:
    To disable challenge questions at start up: http://download.oracle.com/docs/cd/E17904_01/doc.1111/e14308/system_props.htm#BABBDCJH (System Property Named: "Force to set question at start up)
    To change logo: http://download.oracle.com/docs/cd/E14571_01/doc.1111/e14309/uicust.htm#CHDIFJEJ
    In 10G:
    Dig the documentation.
    A suggestion, please go through the documents first as they have quite a bit of information.
    HTH,
    BB

  • How to forward alert from one user to another user and how to reject?

    Hi everybody.
    How to forward alert from one user to another user and how to reject and how to complete alert?
    Regards,
    Vinay.

    What alert are you talking about? Which version of BOE / Edge do you use?

  • Data in application based on User logged in

    Hi,
    We have a requirment in our project in which we need to prefill few fields of all pages of application based on the user logged in. The required information to be populated in application is available in database table.
    When the page is gettign loaded for the first time the databse has to queried and the forms have to be prefilled. One more requiremtn we have is to restrict the data in ADF Read only tables to that specific user.
    Thanks,
    Manasa.

    Hi,
    have a look at SRDemo, which uses a managed bean n session scope for the user specific information. Same could be used to set tables to read only (e.g. checking if user has a specific role granted). So the usecase you mention seems to be easy to achive with JSF on-board functionality
    Frank

  • How to assign Action to multiple Users dynamically in GP

    Hello Experts,
    I have the following scenario in GP
    I have created a Web Dynro GP Callable Object and from my Web Dynpro i need to a pass a list of Users to which a particular Action needs to be assigned.
    I am able to return a single value from web dynpro to gp.
    Can some one help me how to return a list of users to gp.
    I have done the following: In the getDescription method I have added an attribute of multiplicity 1_N:
    IGPStructureInfo outputStruct = technicalDescription.getOutputStructureInfo();
    IGPAttributeInfo list1 = outputStruct.addAttribute("List1", IGPAttributeInfo.BASE_STRING);
    list1.setMultiplicity(IGPAttributeInfo.MULITIPLICITY_1_N);
    then in the complete method I am trying to set an Arraylist to this variable:
    IGPStructure output = execContext.getOutputStructure();
    output.setAttributeValue("List1", userList);
    Here userList is an Arraylist which contains the list of User Id's..
    However I get the following exception:
    com.sap.caf.eu.gp.exception.api.GPInvocationException: Multiplicity of attribute with name List1 and namespace null does not allow single values to be set/received
    at com.sap.caf.eu.gp.structure.impl.GPStructure.setAttributeValue(GPStructure.java:114)
    Can someone help me in knowing how I can return a list as an output parameter to GP from Web Dynpro...
    Regards
    Sundeep

    Hi Srinivasan,
    Of course the Role is Runtime defined...
    I would brief you again the mapping that I have performed in the Design time at the processlevel.
    From Web Dynpro I return a List of type String and Multiplicity 1..N.
    I map this List with the leaf item User Identifier contained in the User List Input parameter of the Assign User to Process Role callable object.
    However since the User Identifier parameter is of cardinality 0..1 only the first value in the returned list is getting assigned to it. Thus the task is getting assigned to only one user.
    Now it is not possible in Design time to Group or consolidate parameters of different types. Thus the List which is of type String cannot be mapped to User List or the User_Item contained within it which are both of type Structure and multiple cardinality.
    I even created a Structure in Web Dynpro of cardinality 1..N and withing it i included a List of type String and cardinality 1..N. Now I returned this Structure from Web Dynpro and tried to map it to the User Item Structure of the Assign User to Process Role Callable object, but doint this the task did not get assigned to any user..
    One question:
    Don't you think that in order for the task assignment to happen using the Assign User to Process Role Callable Object the leaf item User Identifier parameter contained in the User_List input parameter of this callable object needs to be populated with the required User Id's.
    But if the cardinality of this parameter is always 0..1 , is it possible to achive the assignment of an Action to multiple Users at runtime using this Callable Object?
    Can you please explain the parameter mapping you followed in order to achive this...
    Regards
    Sundeep
    I want to ensure that you remain in the top 3 contributors in this forum 
    I will continue to reward points for your answers
    Edited by: Sundeep Sethi on Sep 4, 2008 1:47 PM

  • How we know the Number of users logged into stratus?

    Hai,
    How can we  know the number of users logged into stratus? If we knows only,in our project we can check the users are valid/authenticated.can we check that?
    Advanced Thanx

    Stratus is adobe service which provides you with p2p id or say all your
    application's users a p2p id. Adobe doesn't have any admin section where you
    can manage/see all connected p2p users in your application.
    This you have to implement at your end in your application code i.e.
    authentication,validation and user counter.
    Thanks,
    Vivek.

  • Hide or show column from a report region based on user logged in

    Hi,
    I have this criteria, where I need to display a column on a report page but depends on the users logged in ( APP_User).
    On the field(column page) there is the Conditional Display option
    Conditional Display
    Condition Type: I choose the option where "item value in Expression 1 = expression 1
    *Expression 1*
    App_USER
    *Expression 2*
    I need to add 4 user names here that they allowed to view that column
    My question is how to list the names in expression 2 field, it worked when I added one name, but when I listed 4 names separated by comma, it didn't work.
    I appreciate any help or any solutions from you.
    Thank you.
    Sofia

    If you use "Text in Expression 1 is contained in the Value of Expression 2" then you can provide a comma-separated list. The only thing to watch out for is if you have a user "Bob" and a user "Bob Smith" then you will get a match on "Bob Smith" for the user "Bob"

  • How to close browser window after user log out

    Hi,
    Does anyone know how I can close browser window after user logs out. The scenario is when user clicks a log out button I will invalidate user session and close the browser right away in the backing bean.
    Your help would be appreciated.

    Try run this and you'll see that it runs fine with no exceptions:
    <%
         String someText = "bla bla bla";
         response.setContentType("text/plain");
         response.setHeader("Content-Disposition", "attachment;filename=message.txt");
         try {
              ServletOutputStream os = response.getOutputStream();
              os.write(someText.getBytes());
              os.flush();
              os.close();
         } catch (Exception e) {
              out.println("ERROR: " + e);
    %>It looks like that after I've closed the outputStream I can't do any more processing in the JSP. Even if I remove the setContentType and setHeader methods it still behaves this way.
    I'm starting to think that there's no way around this...??

  • How to find the number of users log into ESS for last three months

    Hi Team
    Is there any transaction / Report to find the number of users logged into the ESS and used the payslip tab. Is this possible to find?
    Waiting for hopeful replies.
    Regards
    Bhaskar

    Bhaskar,
    you can use google analytics,
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50b94044-7008-2b10-1680-c04e4526367b
    jo

  • How to get PERNR based on user ID

    Hi All,
    How to get PERNR based on userid.
    please help me in resolving this.
    Thanks for the support.
    Regards,
    Dhananjaya R E

    hope this will help u
    DATA:   t_pernr LIKE pa0105-pernr,
              t_email LIKE pa0105-usrid_long.
    STEP 1 - Find personnel number for UNAME
       SELECT SINGLE pernr
                 INTO t_pernr
                 FROM pa0105
               WHERE subty = '0001'
              AND endda >= sy-datum
             AND begda <= sy-datum
             AND usrid = p_uname.
    Employee record found*
    IF sy-subrc = 0.
    STEP 2 - Find email address for personnel number*
    SELECT SINGLE usrid_long
             INTO t_email
             FROM pa0105
            WHERE pernr = t_pernr
              AND subty = '0022'
              AND endda >= sy-datum
              AND begda <= sy-datum.

  • How to Limit the Number of Users Logged into HTML DB

    I'm using LDAP based SSO and I'd like to limit the number of users who can log into the application at a given time. If my users are assigned to groups, can I also limit the number of users who belong to a certain group who can be logged in at one time? Can anyone think of any HTML DB APIs that might be useful in doing this?

    Well if you apply a "time-out" on the session and if the there is a HTML DB table in the FLOWS account that can be queried to see the number of sessions, then you could restrict HTML DB sessions to a certain number. But if you have multiple HTML DB applications, how are you going to know which HTML DB session goes which application?
    It is very ugly. I realistically cannot see a way. Maybe the Oracle folks have a way of limiting the sessions internally within HTML DB
    Just out of curiosity, why do you want to limit the number of users? Maybe if you explain that then that might help in coming up with a solution.
    Mike

Maybe you are looking for