Documentation - JC Login As User

JC Login as a User - Installation and Usage Guide

Plugin: System - JC Login as a User (jcloginasuser)  |  Version: 1.0.5  |  Author: Abdulgani Tumbi, JoomConsultant  |  Joomla: 6.2.0

1. What the plugin does

The plugin adds a Login As User button to the Joomla administrator Users list, in a new User Login column. One click opens the website frontend in a new browser tab, already logged in as the selected user. No username or password has to be typed, and the password is never shown.

Typical uses: checking what a member sees after login, testing user roles and permissions, support and debugging, and verifying the customer experience.

  • One-click frontend login: open the site as any user from the Users list.
  • Admin-only: the button is shown only to backend users in the groups you allow in the plugin settings.
  • Short-lived access: each login link is valid for 180 seconds and is bound to the IP address that requested it.
  • No core changes: the plugin uses the normal Joomla plugin system and does not modify core files.

2. Requirements

  • Joomla 6.2.0 (or a compatible 6.x release) with the plugin installed.
  • A backend account that can open Users > Manage (for example a Super User or an Administrator).
  • Pop-ups allowed in the browser for the administrator site, because the frontend opens in a new tab.

3. Step 1 - Install and enable the plugin

3.1 Install the package

  • Log in to the administrator backend.
  • Go to System > Install > Extensions, choose Upload Package File, select the plugin ZIP, and click Upload and Install.

3.2 Find and enable the plugin

  • Go to System > Manage > Extensions.
  • Type jc in the search box. The list shows the component JC System Report and the plugin System - JC Login as a User.
  • In the Status column, a green check means the plugin is enabled. If it is not, click the status icon once.
  • The message Extension enabled. confirms the change.

Extensions Manage: plugin enabled

Figure 1 - Extensions: Manage, search for "jc", plugin enabled.

4. Step 2 - Configure the plugin and allowed user groups

4.1 Open the plugin settings

  • In Extensions: Manage, click System - JC Login as a User.
  • Check that Status is Enabled and Access is Public.

4.2 Select the allowed user groups

  • Click the Allowed User Groups box and select only the groups that should see the Login As User button. In the example, Super Users is selected.
  • Click the x on a group chip to remove it.
  • Click Save & Close.

Plugin settings: Allowed User Groups

Figure 2 - Plugin settings: Allowed User Groups (Super Users selected) and Status Enabled.

Setting Where Recommended value
Status Right-hand panel Enabled
Access Right-hand panel Public (leave as is)
Allowed User Groups Plugin Basic Settings Only the groups allowed to log in as users, for example Super Users
Empty Allowed User Groups Plugin Basic Settings Not recommended: every group is then allowed, so every backend user sees the button

5. Step 3 - Use the Login As User button

5.1 From the Users list

  • Go to Users > Manage.
  • In the User Login column, click the blue Login As User button on the row of the user you want to check.
  • A new browser tab opens the frontend, logged in as that user.
  • The backend session stays open in the first tab.

Users list with Login As User button

Figure 3 - Users > Manage with the User Login column.

5.2 From the user edit screen

  • Open a user with Users > Manage and click the name to edit the account.
  • The toolbar shows a blue Login As User button (next to Close). Click it to open the frontend as that user.

6. Step 4 - What you see on the frontend

After the new tab opens, the frontend shows the selected user account. In the example, the Cassiopeia template shows the Login Form module with the greeting Hi admin, and a Log out button. Check the greeting first to confirm the correct account.

Frontend after Login As User

Figure 4 - Frontend (Cassiopeia) after Login As User.

  • Test the page as this user: menus, restricted articles, user-only modules, profile pages.
  • When finished, click Log out in the frontend, close the tab, and return to the backend.
  • If you were already logged in on the frontend as another user, the plugin first logs that user out and then opens the target account. Click Login As User again if the first attempt only logs you out.

7. Troubleshooting

Symptom Likely cause Fix
No Login As User button in the list Plugin disabled, or your group is not in Allowed User Groups Enable the plugin (Step 1) and add your group (Step 2)
Button shows but nothing opens Pop-up blocked Allow pop-ups for the administrator URL and click again
"This link has expired" The link is older than 180 seconds Click Login As User again
"Failed to generate login token" or "Login failed" Session expired or AJAX request blocked Refresh the backend, log in again if needed, retry
Frontend not logged in as the user Plugin not enabled, or the IP changed between click and open Check Status is Enabled, use the same computer and network, retry
Old button behaviour after an update Cached JavaScript System > Clear Cache, then reload with Ctrl+F5

8. Technical analysis (how the plugin works)

Based on plugin version 1.0.5 (jcloginasuser.php, jcloginasuser.js, jcloginasuser.xml).

8.1 Files

  • jcloginasuser.php: server logic. Loads the JavaScript on the Users pages, creates login tokens (AJAX handler), and accepts tokens on the frontend (onAfterRoute).
  • media/js/jcloginasuser.js: adds the User Login column, the Login As User buttons, and the toolbar button on the user edit screen.
  • jcloginasuser.xml: manifest and the Allowed User Groups setting (usergroup parameter).

8.2 Login flow

  1. The Users page loads the plugin JavaScript only when the current user is in an allowed group.
  2. Clicking the button calls index.php?option=com_ajax&plugin=jcloginasuser&format=json&userid=ID.
  3. The AJAX handler builds a token containing userid, expiry time and IP, signs it with HMAC-SHA256 using the site secret key, and Base64-encodes it. The token is valid for 180 seconds.
  4. The browser opens index.php?token=... in a new tab.
  5. On the frontend, onAfterRoute decodes the token, checks expiry and IP, verifies the signature, and loads the target user.
  6. If a frontend user is already logged in, that user is logged out and the page reloads. Otherwise the plugin fires onUserLogin for the target user and redirects to the home page.

No password is read, shared or displayed. The login runs through Joomla's user plugins, so the normal login events fire.

9. Security review

The plugin is useful for testing, but its security depends on who can use it. These points come from reading the code and were not tested live. Verify and fix the High and Medium items before using the plugin on a live site.

Severity Finding Recommendation
High Allowed User Groups only controls whether the button and JavaScript are shown. The server handler (onAjaxJcloginasuser) checks only that the request comes from the administrator client. Any backend user who can send this request can get a token for any user ID, including Super Users, so a non-Super User administrator could log in as a Super User. In onAjaxJcloginasuser, check that the requesting user is in an allowed group and has core.manage on com_users. Refuse targets with equal or higher rights (for example Super Users) unless the requester is a Super User.
Medium Tokens are not single-use. Anyone who sees the URL (browser history, screen sharing, proxy logs) can reuse it for the 180-second life from the same IP. Store each used token in the cache and reject a second use.
Medium The token is placed in the URL query string, where it can appear in browser history and server access logs. Accept the token once and remove it quickly; consider a one-time code exchanged by POST.
Medium The token path fires onUserLogin directly and does not run the normal password or two-factor (MFA) checks. If the target account uses MFA, that check may be skipped. Verify on the live site. Test an MFA-enabled account. If MFA is skipped, check the target MFA status or restrict use to test sites.
Low If Allowed User Groups is empty, every group is returned and every backend user sees the button. Always select explicit groups.
Low Failed or expired token attempts are logged (category jcloginasuser) only if logging is enabled. Enable logging for jcloginasuser in System > Global Configuration > Logging.
Info The plugin does not write login-as activity to the User Actions Log. Record use manually (who, which account, when) if an audit trail is required.

9.1 Safe use checklist

  • Use the plugin on a development, staging or test site whenever possible.
  • Allow only the groups that need it, and never leave Allowed User Groups empty.
  • Disable the plugin when it is not needed.
  • Do not share Login As User links, and log out of the frontend when testing is finished.
  • Fix the High finding (server-side group check) before using the plugin on a production site.

10. Quick reference

  • Install: System > Install > Extensions, upload the ZIP, Upload and Install.
  • Enable: Extensions: Manage, search jc, click the status icon until it shows a green check.
  • Configure: open System - JC Login as a User, set Allowed User Groups, Save & Close.
  • Use: Users > Manage, click Login As User in the User Login column (or on the user edit toolbar).
  • Check: the frontend shows the target user greeting; click Log out when finished.

Based on the plugin code (version 1.0.5) and screenshots taken on Joomla 6.2.0.