Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 755263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:06:35+00:00 2026-05-14T15:06:35+00:00

We have a requirement, wherein the administrative user needs to proxy in as a

  • 0

We have a requirement, wherein the administrative user needs to proxy in as a certain user in an environment where several users (Role: User) are managed by an administrator (Role: Admin).

e.g If we have the following users in the database (admin, user1, user2, user3), we would want the admin to proxy as ‘user2’ and use the system in certain scenarios. Authentication in our web application is based username / password credentials, what mechanisms are available for the admin to proxy as ‘user2’ when he doesn’t have the password for ‘user2’. How can the application track such access for audit purposes to mention that ‘admin’ had proxied for ‘user2’ and performed certain actions.

I am looking for suggestions on supporting this in our j2ee (jboss seam) web application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:06:35+00:00Added an answer on May 14, 2026 at 3:06 pm

    You can create a custom registerAdminAsUser() method.

    @Name("authenticationProxy")
    public class AuthenticationProxy {
    
        private @In org.jboss.seam.security.Identity identity;
    
        /**
          * Starting with Seam 2.1+, you should use Credentials instead of Identity
          * To collect your username and password
          *
          * Your JSF Form should looks like
          *
          * <h:inputText value="#{credentials.username}"/>
          * <h:inputSecret value="#{credentials.password}"/>
          */
        private @In org.jboss.seam.security.Credentials credentials;
    
        public String registerAdminAsUser2() {
    
            identity.getCredentials().setUsername("user2");
    
            /**
              * Here you should provide any role which should be assigned to User2
              */
            identity.addRole("<A_ROLE>");
            identity.addRole("<OTHER_ROLE>");
            identity.addRole("<ANOTHER_ROLE>");
    
            /**
              * Do not call login method because it will call authenticate one
              * You do not have User2 password
              */
            // identity.login();
    
            return "loggedIn";
        }
    
        /**
          * Be aware you may need a unregisterAdminAsUser2
          */
    
    }
    

    And to enable your proxy, create a commandButton

    <h:commandButton value="register Admin as User2" value="#{authenticationProxy.registerAdminAsUser2}" rendered="#{credentials.username == 'admin'}"/>
    

    To use some JSF component, do as follows

    <h:commandLink rendered="#{s:hasRole('<ANY_ROLE_ASSIGNED_TO_USER2_GOES_HERE>')}"/>
    

    I hope it can be useful to you!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a requirement wherein I need to display on a User form, a
I am new to extension development, I have a requirement wherein I need to
I have a requirement in JasperReports wherein I need to display the field based
I have requirement where when a user enter new item in a list first
I have requirement where I need to allow users to upload a Word document
I have a requirement wherein i should write a method of type String[] and
I have a requirement where-in my Silverlight application needs to connect to a WCF
I have a requirement wherein I need to display a list of employees and
I have a requirement wherein I have to buffer a lot of data (in
I am using Asp.net/C# to build an application , i have a requirement wherein

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.