-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LaunchApplicationAsync() throws 'Unauthorized' exception #279
Comments
Hi David,
Is there any chance you're running this with the connection address at loopback/localhost?
Does every app you're attempting to launch fail with this?
Thanks,
Hirsch
…________________________________
From: DavidRatliff <[email protected]>
Sent: Thursday, November 23, 2017 11:41:52 AM
To: Microsoft/WindowsDevicePortalWrapper
Cc: Subscribed
Subject: [Microsoft/WindowsDevicePortalWrapper] LaunchApplicationAsync() throws 'Unauthorized' exception (#279)
I am attempting to remotely launch a Hololens application. My code, as posted below, throws an 'Unauthorized' exception. To my understanding, this exception is used for missing or incorrect credentials, but that cannot be the case, as the portal connection opens successfully. I am running this project as a UWP from the Unity Editor. Any help is greatly appreciated!
private async Task LaunchApplication()
{
try
{
Debug.Log("Launching...");
await portal.LaunchApplicationAsync(appid, packageName);
Debug.Log("Launched");
}
catch (DevicePortalException e)
{
Debug.Log(e.Reason);
}
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FWindowsDevicePortalWrapper%2Fissues%2F279&data=02%7C01%7Chirsin%40microsoft.com%7Cfe1c4ccb9f554093dc2208d532aa3f64%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636470629148047611&sdata=xQZ2l2X91BY4T2XhJk%2FsUd0NubW%2F%2BYcU%2FfrUHuy7fEQ%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABltO2wX40JwW1ugn_dFrFrK9KlXMW-Yks5s5cqAgaJpZM4QpIk9&data=02%7C01%7Chirsin%40microsoft.com%7Cfe1c4ccb9f554093dc2208d532aa3f64%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636470629148047611&sdata=mwwoa5kg2n6XoQE1IsyaiDcNMnszVkk3EsqODoAsPSo%3D&reserved=0>.
|
I have tried connecting at localhost and via internet, and with several different apps. All produce this exception. Thanks for the response! |
Hm - do the other REST APIs work? e.g. you can get the device family? One thing to be aware of is that there might be two LaunchApplication APIs, one of which is for IoT. |
Yes, upon connection I can successfully retrieve the Hololens IP, OS version, and device family. If I'm reading the documentation correctly, there is only a single LaunchApplication request type, used for both Hololens and IoT. |
Ah, yes, you're correct. Can you share how you're getting the AppId and the packageName? |
Apologies for the inactivity, it's been finals season for me. I'm pulling that information manually from the response to the /api/app/packagemanager/packages request. For example: appid = "Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" |
I got it working by changing the auth to basic auth. in HttpHeadersHelpers I added
and I removed the credential stuff from the HttpClientHandler initializations
|
I am attempting to remotely launch a Hololens application. My code, as posted below, throws an 'Unauthorized' exception. To my understanding, this exception is used for missing or incorrect credentials, but that cannot be the case, as the portal connection opens successfully. I am running this project as a UWP from the Unity Editor. Any help is greatly appreciated!
The text was updated successfully, but these errors were encountered: