write data string to msedge localstorage on behalf of web-site

Matthew Strong 1 Reputation point
2021-03-10T19:16:11.193+00:00

Good Day. I have a need for some automation to write data to MS Edge browser's localstorage on behalf of a web-site - in preparation for that web-site to read the data for web-client specific configuration.

We are deploying an IIS web app into our internal windows domain. The app is published by a software developer, so we have limited ability to change the inner workings/behavior of the application directly, however we have a need to centrally manage one piece of data that is referenced by this web app; however the platform provides no easy means of central management

The app is a point of sale system and invokes credit card devices that also run on our local intranet. The platform's database has a translation table of NetBios-to-CreditCardDeviceIP relationship, so the system knows which CC machine's IP to invoke when a given workstation name processes a transaction. Problem is the middleware tier of this web app (which invokes the credit card devices) has no way of obtaining the active web client name (workstation's NetBios name) during a transaction execution due to proper web security standards. That said, we own both server and client side within the same windows domain, so we can realistically circumvent this security boundary.

The web front end's login screen has a mechanism by which we can manually enter a data string - this mechanism uses localStorage.setItem. If we enter the workstations' NetBios name it satisfies the platform's requirement of needing the Netbios name to invoke the correct CC machine.
Problem is that we want to automate this process; be able to have the NetBios name entered as a string using localStorage.setItem for this web-site, before the web-site loads. This prevents the end user (or IT department) from having to manually set this string at each machine. (This manual process is further complicated by the fact that everything is siloed at a user level, so if we have multiple users on a given workstation the data string would have to be set at least one time per user per machine. Does not scale well...)

As far as I have observed: in Edge the data string belongs to the web-site (origin domain) so, being able to manually write that type of data on behalf of the web-site might violate web security standards - not to mention that I cannot find any mechanism (was hoping for a GPO) that would perform this task.
Best solution I could come up with so far was to write a simple html page containing a script and set that page as the default document for the site - to execute a script and then redirect the browser to the /VirtualDirectory that is the platform's web-front-end login screen.

The script would have to: Run under the web app's origin domain. Detect the workstation's netbios name and write this string to the LocalStorage using LocalStorage.SetItem in preparation for the actual web app referencing it. I have been researching this for a few days and think it might be possible. The piece I have not been able to confirm is if, through Edge, we can obtain the NetBios name via the web client.

Has anyone gone down this path before? If so, any documentation references or other advice would be very handy. We have a developer on-site who is fluent in a number of programming languages, so this shouldn't be a terrible stretch.

[IIS - Default Document - <Run script to obtain netbios name in VAR and write to localstorage.setitem> - redirect browser to /virtualdirectory for user login].

   Insights, Comments, Ridicule all invited,
                     Thank you,
Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,349 questions
Internet Information Services
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Deepak-MSFT 2,201 Reputation points Microsoft Vendor
    2021-03-11T06:13:32.337+00:00

    @Matthew Strong ,
    You had asked, "The piece I have not been able to confirm is if, through Edge, we can obtain the NetBios name via the web client."
    I try to search but did not get any way to fetch NetBios name by running any script with the Edge browser.
    I suggest you contact the developer of the site for fixing this issue properly.
    Thanks for your understanding.

    ----------

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.