Can I Show Windows Authentication Dialog When Trying To Connect To Un-Authenticated Network Path - vb.net

In my application, it allows users to remotely connect computers and folders within the internal network for troubleshooting, etc.
My problem is that some of these computers that they are trying to connect to haven't yet been authenticated for them, so when I plug the UNC path into a new process for explorer, it doesn't error but simply returns some random local folder (My Documents I think).
My question is... Is there a way I can make a call to the windows authentication dialog to allow the user to authenticate against the remote PC? If the user simply enters the same address into a normal explorer window, the authentication screen will appear, however, using my app it doesn't.
Is there anyway I can force this to show up for the user?
Any help appreciated, thanks.

Based on this discussion:
Prompting for network credentials in VB.NET
You can have a look at CredUIPromptForCredentials API, in vb.net, just P/Invoke it. For more information:
http://www.pinvoke.net/default.aspx/credui/CredUIConfirmCredentials.html
http://msdn.microsoft.com/en-us/library/aa375177(VS.85).aspx

Related

Git authentication not opening VSCode as "other user"

To set the scene: I work in a highly restricted SOE. I can only sign in as a standard user, but have administrative access through "Run as other user" or "Run as administrator".
When trying to setup GitHub access, VSCode running as administrator opens an authentication window in a browser that then wants to re-open VSCode. The issue is, reopening VSCode in this manner only opens as the standard user, not running as administrator. This happens connected to the internet through the work network, and via hotspot.
I am NOT permitted to sign-in directly as administrator.
My colleague has told me there used to be a way to sign in by copying and pasting a token directly into VSCode, but this appears to no longer be an option.
Is there another way to authenticate GitHub with VSCode, other than the web-based sign-in?
Thanks
I was able to work around this some time ago by getting a Personal Access Token working.
The environment I'm forced to work in made even this difficult, but got there eventually.

How does one interact with the user from a vb.net service?

I've got one for you thats been bugging me for a bit.
If you run a Windows Service as Local System, how can that service display forms or prompts on the user desktop?
I tried this in one of my previous apps and couldn't get it to work; I settled on having an 'invisible' app running in the user context to handle any user interaction. But as time has passed, I've seen some apps that have nothing more than a service running as local system and yet they produce prompts and forms on the user desktop.
Thanks in advance for any info :)

Access text file content from USB storage automatically from a server

I want to read the content of a text file (serves as a key) stored inside a USB mass storage automatically when the user is authenticated by his matching username and password for that website. It's like the textfile(key) is the extended authentication.
I think this needs to can be done by a (1) native program? or an (2) applet? What do i need to study? Can someone give me an overview for the process to make this possible?
Quite good in web tech but not with native app.
You cannot access USB mass storage devices through chrome.usb as they are claimed and handled by the host operating system.
Instead you could use the chrome.fileSystem API, but the user will need to select the file. Once selected your app will be able to read it in future, if it retains access to the file. See the API documentation for more details.
If you want this only for Internet Explorer, You can create an Active X. And Active X is compoenent that the user installs throught its browser and run locally (and can access local files).
Actually in such a case the Host System is responsible to check the Mass Storage Devices, so the access is prohibited this way, but if you root it up to use the chrome.fileSystem.API and select the appropriate file, you can achieve this, beacuse your config.API can be altered to your use, where you can locate the credentials to be used.(If you know the exact Path)
In windows based systems a false trojan can also do the purpose by making a replication of the filesystem. Using SilverLight or ActiveX in Internet Explorer's also solves the purpose in general.
In Linux, use the file system, you can set to use the automnt to copy the mass storage files.
Why not try building a .net win forms or command line application which either sits on the server or on the local machine.
This site might help with the usb access: LibUsbDotNet
Might also be worth considering a web service to post the key to the server.
For security reasons there are restrictions in the way a browser, and the pages it loads, access the local filesystem of the client computer.
Is it safe to assume you only require this to work on a specific browser? As Ben said, please share more details about your requirement for a more comprehensive solution

Automate windows login using vb.net?

I am try to Develop a application that can control a PC using SMS with internet. also i turn on the PC power with a cell phone. but After i turn on the PC it will ask for username & password! I store this information on a local database (Eg:MS ACCESS). how can i get that username & password then log in to PC using a VB.NET Program?
First, to read the database your application will need to be already running before the user is logged in, like a system service. Can you do all the stuff you want to do within this service without logging in actually? This would spare you the horrors of...
Gina. At least up to XP to log into your computer without entering the password on the keyboard you can store the credentials in the registry (remove password login, autologin every time) or implement a custom gina.dll that can "simulate" a user. VB.Net cannot be used to write a custom gina.dll as far as I know, you will need to use C/C++ for this.
Added: At least in theory you could simulate keypresses via usb, remote control your local machine or something other to simulate a keyboard, anything might be better than Gina ; )

Integrated Windows Authentication showing wrong loggedin user

I have an asp.net 2.0 application running on IIS 6.0. I am using Integrated Windows Authentication. Some users have two network accounts, a personal account and an administrative account. The problem I am facing is that sometimes when they are logged in on the client side using their personal accounts, the logged in user appears at the server side as the admin account. I am retrieving the logged in user network id using System.Security.Principal.WindowsIdentity.GetCurrent().Name.
I suspect that their admin credentials are being cached somewhere and passed instead.
I had exactly this same problem. The web site was seeing me authenticate as my admin account even though I was logged in as my personal account.
It turns out that in Windows you can associate specific user names and passwords with particular sites. Once that is done, the integrated authentication through IE (and Chrome!) always uses those credentials. And, to make things easy, there is no obvious way to get to those settings through Internet Explorer's settings or options.
To fix your issue on Windows XP:
Click Start, Settings, Control Panel, User Accounts.
Click the Advanced tab.
Click Manage Passwords.
Find the entry in the list the corresponds to the site(s) where you're seeing this behavior. Remove it.
Credit where credit is due: This answer was taken almost word-for-word from an unnamed "Junior Member" at ObjectMix.
For Windows 7, use "Control Panel/Credential Manager" (also available via "Control Panel/User Accounts/Manage Your Credentials"). This lists all cached credentials, and lets you easily delete the ones which are causing problems.
When you use Remote Desktop to connect to a server and save your login credentials, it doesn't only save them for remote desktop, it also uses them for connecting through IE and, apparently, Chrome.
This is an old issue, and still valid. I just found if you save credentials while using mstsc (Remote Desktop), and try to use Integrated Windows Auth against any site that is CNAMEd to that server, it will use the saved credentials. Those will be the ones you need to delete.
My PC is locked down at work and IT have removed Credential Manager from the menu in Control Panel.
I was able to get around this by running cmdkey /list from the command line. In the list of "Currently stored credentials" I located the offending hostname and ran cmdkey /delete:[hostname] (no sq. brackets and replace hostname with your host), which fixed the issue for me.
According to this site, rundll32.exe keymgr.dll, KRShowKeyMgr will bring up the dialog to do this as well.
Some background info: http://windows.microsoft.com/en-gb/windows7/what-is-credential-manager