cancel
Showing results for 
Search instead for 
Did you mean: 
Jeff
Archer Employee
Archer Employee

Starting with Archer 6.7, the logged in user is displayed as username in the upper-right corner of window instead of the user’s first name as in older versions.  This change was intentional as part of the 6.7 user interface improvements.  Then starting with 6.9 SP1, the navigation bar displays the user's first name like it used to in 6.6 and older.  For more details, check out RSA Announces Availability of RSA Archer Release 6.9 SP1.  

Currently, there is not a configurable option for an Archer administrator to control what is displayed, so please vote up Add options to control how the logged in user is displayed in Navigation Bar.  

There is a possible workaround by modifying the Home.aspx file, but it's not supported and only for on-premise environments.  If any issues are encountered in Archer, the workaround will need to be removed and the issue reproduced again.  Be sure to test in a non-prod environment too.

NOTE: The workaround will need to be reapplied each time the Archer installer is ran for the Web component because the Home.aspx file will be overwritten.  Archer Support or Engineering teams will not be able to customize or enhance it.

 

Description Display Javascript (used in code below)
Username pastedImage_4.png  
First Name pastedImage_13.png ArcherApp.globals.firstName
First and Last Name pastedImage_16.png ArcherApp.globals.firstName + ' ' + ArcherApp.globals.lastName
Display Name pastedImage_17.png ArcherApp.globals.displayName
Static Text / No Name pastedImage_18.png 'Options'
Too much text with small words pastedImage_19.png 'Hi ' + ArcherApp.globals.firstName + ', welcome to the Archer Lab'

 

How to update the Home.aspx to use a different value

From each Archer web server:

  1. Open the Archer site’s virtual directory folder and go to \apps\archerapp\.  Example: c:\inetpub\wwwroot\RSAarcher\apps\archerapp\
  2. Make copy of Home.aspx file.
  3. Open Home.aspx file in Notepad…right-click file and select Edit.
  4. Go to around line 80-90...after “ArcherApp.build = 'prod';” and before the line with “</script>”.
  5. Paste the following javascript code to display anything except username.  To use something else besides first and last name, change the myObj.innerText value using the javascript code from chart above.
    var changeDisplayName = setInterval(function () {
    	// 6.7  : #navigationloader > div > * > ul > * > button > span > h1
    	// 6.8+ : #navigationloader > div > * > ul > * > button > span > p
    	var myObj = document.querySelector("#navigationloader > div > * > ul > * > button > span > p");
    	if (typeof myObj != 'undefined' && myObj != null) {
    		myObj.innerText = ArcherApp.globals.firstName + ' ' + ArcherApp.globals.lastName;
    		clearInterval(changeDisplayName);
    	}
        }, 500
    );
  6. If you want to display username, paste the following javascript code instead.
    var changeDisplayName = setInterval(function () {
        var myObj = document.querySelector("#navigationloader > div > * > ul > * > button > span > p");
        if (typeof myObj != 'undefined' && myObj != null) {
            var baseURL = window.location.protocol + '//' + window.location.host + ArcherApp.globals['baseUrl'];
            var csrfToken = window.sessionStorage.getItem("x-csrf-token");
            var headers = { 'x-csrf-token': csrfToken };
            var apiURL = '/api/core/system/user/' + ArcherApp.globals.userId;
            var verb = 'GET';
            $.ajax({
                headers: headers,
                type: verb,
                url: baseURL + apiURL,
                data: '',
                contentType: 'application/json',
                processData: false,
                async: true,
                dataType: 'json',
                success: function (data, textStatus, jqXHR) {
                    myObj.innerText = data.RequestedObject.UserName;
                },
                error: function (data, textStatus, jqXHR) {
                    console.log('Error getting user info. ' + apiURL);
                    console.log(data);
                }
            });
            clearInterval(changeDisplayName);
        }
    }, 500
    );​
  7. Save file.
  8. Refresh browser.

NOTE: If the browser does not see the change immediately depending on server or browser cache settings, try the following steps on each web server.

  1. Stop IIS.
  2. Browse to C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
  3. Delete all folders. These are cached or temp files used by web sites like Archer.
  4. Start IIS.
  5. Refresh browser.
  6. If simple IISRESET doesn’t work and environment uses a load balancer, try clearing the load balancer cache if possible.

 

How to get the "path" to username value

If the generic query selectors no longer work using the wildcards, try these steps to get the query selector or path to the username using Chrome DevTools.

  1. Login to Archer using Chrome.
  2. Right-click the username in upper-right corner and select Inspect option.
  3. From DevTools window in the Elements tab, the HTML line of code for the username will be highlighted.
  4. Right-click the row and select Copy > Copy selector option. The query selector/path will be copied to clipboard.  
  5. Paste the value to Notepad or a temp location to be used later.  Sample query selector:
    #navigationloader > div > div.MuiGrid-root.jss484 > ul > li:nth-child(8) > button > span > p

   pastedImage_24.png

 

NOTE: This is not an RSA supported product and is intended as a proof-of-concept for non-prod environments and testing purposes.  Archer Support or Engineering teams will not be able to customize or enhance it.

2 Comments