Launching UWP application as system prior to Windows Login

Viewed 230

Use Case

Currently I am developing a Windows Login Provider which uses a Windows Universal App (UWP) to be able to capture a selfie using a webcam of the workstation. This use-case consist of two components:

  1. Windows Login Provider: This component is a COM object that talks with the Windows ICredentialProvider. This component gives me unlimited possibilities to interact with an user before logging in. The main goal is to require additional identification details about the user.
  2. Webcam UWP: This is a Windows Universal Application (UWP) which displays a Live View of the Webcam feed on a laptop, and is able to take picture controlled by the user. I configured the UWP to start with a Declaritive URI. With this we can start the application using Windows Run.

Goal

The goal of this use-case is to launch the Webcam UWP application the Windows login phase. So when a user is booting its laptop and is prompted for his credentials using my Credential Provider, an additional webcam application is launched to take a portrait photo.


Problem

The main issue where I am running into is that I am not able to start the webcam application during Windows Login screen. During development I can test my Credential Provider with CredUI (The CredUIPromptForWindowsCredentials function creates and displays a configurable dialog box that allows users to supply credential information by using any credential provider installed on the local computer), with this I can test my Credential Provider and also launching the Webcam UWP application. This is working successfully and I want to achieve the same result during Windows Login, but unfortunately it doesn't. I think there are two possibilities that result in a negative outcome:

1. Insufficient Permissions to launch the UWP application during Windows Login

Note: In my CredentialProvider launch my programs with the Process Class:

Process.Start("<application name>");

Windows UWP application code signing consists out of multiple categories. I signed with Visual Studio my UWP application with a self signed certificate. The outcome of this code signing is that my UWP app is signed with SignatureKind: Developer. You can see in below screenshot Powershell GetAppPackage: Details Custom UWP application

During my testing I found that during Windows Login the UWP is unable to launch. I receive a popup with the following error: "You'll need a new app to open this *** link. My thought process was that maybe my UWP application is not configured correctly. So I tried using the Windows Calculator which has a different SignatureKind: Store, since it is an application you can download from the Windows Store. With Calculator I received the same error.

Digging a bit deeper into this problem I found out about the different Signaturekinds. According to Microsoft only the SignatureKind System has additional capabilities but they are no where to be found. The description of SignatureKind System is:

The package is signed by a certificate that's also used to sign the Windows Operating System. These packages can have additional capabilities not granted to normal apps. For example, the built-in Settings app.

To test this I used Windows Narrator application (which has a SignatureKind with System) to be launched from my Credential Provider. The outcome is my desired goal. Successfully the Windows Narrator Application launched and was reading out loud information during my Windows login session.

2. URI activation not working during Login Session

When looking in Windows Event Viewer I can see the following error.

The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event:

(devenv.exe, PID 16724, Thread 1) IdleProcessorManager.DoWork - Job threw:
Invalid URI: The format of the URI could not be determined. at
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at Microsoft.VisualStudio.TestTools.TestCaseManagement.SolutionIntegrationManager.IsRunConfig(String filename)
   at Microsoft.VisualStudio.TestTools.TestCaseManagement.SolutionIntegrationManager.<AddSolutionFilesRunConfigsToTmi>d__351.MoveNext()
   at Microsoft.VisualStudio.TestTools.TestCaseManagement.IdleProcessorManager.DoWork()

I am ware that UWP application uses OnLaunched & OnActivated functions to start etc. For instance the ActivationKind. I am not familiar with this, so maybe this can be a solution?


Given the above information I hope anyone has experience in solving my problem. The outcome is that I want to be able to launch my custom webcam UWP application during login screen on Windows, just like Windows Narrator. Any help is appreciated!

0 Answers
Related