Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 2.47 KB

File metadata and controls

32 lines (21 loc) · 2.47 KB

Dual Support (Azure DevOps/TFS) Client Sample

For windows native applications which want to target both Azure DevOps and TFS we recommend using the Client Libraries for Azure DevOps and TFS to generate interactive sign in prompts for Azure DevOps users and leverage seemless Windows credential authentication for TFS users.

Sample Application

This buildable sample will walk you through the steps to create a client-side console application which uses Client Libraries - Interactive and Windows Auth to authenticate a Azure DevOps or TFS user and return a list of all projects inside a selected Azure DevOps account or TFS collection.

To run this sample you will need:

Step 1: Clone or download vsts-auth-samples repository

From a shell or command line:

git clone https://github.com/Microsoft/vsts-auth-samples.git

Step 2: Install and configure Client libraries (optional)

Packages: Microsoft.VisualStudio.Services.Client, and Microsoft.TeamFoundation.Core.WebApi have already been installed and configured in the sample, but if you are adding to your own project you will need to install and configure it yourself.

Step 3: Run the sample

  1. Navigate to the ADAL C# sample in cloned repo vsts-auth-samples/DualSupportClientSample/.
  2. Open the solution file VstsTfsSample.sln in Visual Studio 2017.
  3. Use Nuget package restore to ensure you have all dependencies installed.
  4. Open CS file Program.cs and there is a section with input values to change at the top of the class:
  5. Build and run the solution. After running you should see an interactive login prompt if you are a Azure DevOps user. If you are a TFS user authentication should happen in the background. After authentication and authorization, a list of all projects inside of your account will be displayed in the console.