Skip to content

Commit ca42e26

Browse files
Update Program.cs
1 parent 6828efc commit ca42e26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ManagedClientConsoleAppSample/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ namespace ManagedClientConsoleAppSample
1111
class Program
1212
{
1313
//============= Config [Edit these with your settings] =====================
14-
internal const string vstsCollectionUrl = "https://myaccount.visualstudio.com"; //change to the URL of your VSTS account; NOTE: This must use HTTPS
14+
internal const string azDevOrganizationUrl = "http://dev.azure.com/myaccount"; //change to the URL of your Azure DevOps account; NOTE: This must use HTTPS
1515
internal const string clientId = "872cd9fa-d31f-45e0-9eab-6e460a02d1f1"; //change to your app registration's Application ID, unless you are an MSA backed account
1616
internal const string replyUri = "urn:ietf:wg:oauth:2.0:oob"; //change to your app registration's reply URI, unless you are an MSA backed account
1717
//==========================================================================
1818

19-
internal const string VSTSResourceId = "499b84ac-1321-427f-aa17-267ca6975798"; //Constant value to target VSTS. Do not change
19+
internal const string azDevResourceId = "499b84ac-1321-427f-aa17-267ca6975798"; //Constant value to target Azure DevOps. Do not change
2020

2121
public static void Main(string[] args)
2222
{
@@ -32,7 +32,7 @@ public static void Main(string[] args)
3232
{
3333

3434
//PromptBehavior.RefreshSession will enforce an authn prompt every time. NOTE: Auto will take your windows login state if possible
35-
result = ctx.AcquireTokenAsync(VSTSResourceId, clientId, new Uri(replyUri), promptBehavior).Result;
35+
result = ctx.AcquireTokenAsync(azDevResourceId, clientId, new Uri(replyUri), promptBehavior).Result;
3636
Console.WriteLine("Token expires on: " + result.ExpiresOn);
3737

3838
var bearerAuthHeader = new AuthenticationHeaderValue("Bearer", result.AccessToken);
@@ -41,7 +41,7 @@ public static void Main(string[] args)
4141
catch (UnauthorizedAccessException)
4242
{
4343
// If the token has expired, prompt the user with a login prompt
44-
result = ctx.AcquireTokenAsync(VSTSResourceId, clientId, new Uri(replyUri), promptBehavior).Result;
44+
result = ctx.AcquireTokenAsync(azDevResourceId, clientId, new Uri(replyUri), promptBehavior).Result;
4545
}
4646
catch (Exception ex)
4747
{

0 commit comments

Comments
 (0)