Skip to content

Commit d910009

Browse files
author
Justin Marks (MSFT)
committed
Fixing DeviceCode sample
1 parent c69d43d commit d910009

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

DeviceProfileSample/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace DeviceProfileSample
1414
public class Program
1515
{
1616
//============= Config [Edit these with your settings] =====================
17-
internal const string vstsCollectionUrl = "http://myaccount.visualstudio.com"; //change to the URL of your VSTS account
17+
internal const string vstsCollectionUrl = "https://myaccount.visualstudio.com"; //change to the URL of your VSTS account; NOTE: This must use HTTPS
1818
//==========================================================================
1919

2020
internal const string VSTSResourceId = "499b84ac-1321-427f-aa17-267ca6975798"; //Static value to target VSTS. Do not change
@@ -27,8 +27,9 @@ public static void Main(string[] args)
2727
try
2828
{
2929
DeviceCodeResult codeResult = ctx.AcquireDeviceCodeAsync(VSTSResourceId, clientId).Result;
30+
Console.WriteLine("You need to sign in.");
31+
Console.WriteLine("Message: " + codeResult.Message + "\n");
3032
result = ctx.AcquireTokenByDeviceCodeAsync(codeResult).Result;
31-
Console.WriteLine("Token expires on: " + result.ExpiresOn);
3233

3334
var bearerAuthHeader = new AuthenticationHeaderValue("Bearer", result.AccessToken);
3435
ListProjects(bearerAuthHeader);

0 commit comments

Comments
 (0)