File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
ManagedClientConsoleAppSample Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public static void Main(string[] args)
33
33
Console . WriteLine ( "Token expires on: " + result . ExpiresOn ) ;
34
34
35
35
var bearerAuthHeader = new AuthenticationHeaderValue ( "Bearer" , result . AccessToken ) ;
36
- ListProjects ( VSTSAccountName , bearerAuthHeader ) ;
36
+ ListProjects ( bearerAuthHeader ) ;
37
37
}
38
38
catch ( UnauthorizedAccessException )
39
39
{
@@ -64,15 +64,15 @@ private static AuthenticationContext GetAuthenticationContext(string tenant)
64
64
return ctx ;
65
65
}
66
66
67
- private static void ListProjects ( string vstsAccountName , AuthenticationHeaderValue authHeader )
67
+ private static void ListProjects ( AuthenticationHeaderValue authHeader )
68
68
{
69
69
// use the httpclient
70
70
using ( var client = new HttpClient ( ) )
71
71
{
72
72
client . BaseAddress = new Uri ( vstsCollectionUrl ) ;
73
73
client . DefaultRequestHeaders . Accept . Clear ( ) ;
74
74
client . DefaultRequestHeaders . Accept . Add ( new System . Net . Http . Headers . MediaTypeWithQualityHeaderValue ( "application/json" ) ) ;
75
- client . DefaultRequestHeaders . Add ( "User-Agent" , "VstsRestApiSamples " ) ;
75
+ client . DefaultRequestHeaders . Add ( "User-Agent" , "ManagedClientConsoleAppSample " ) ;
76
76
client . DefaultRequestHeaders . Add ( "X-TFS-FedAuthRedirect" , "Suppress" ) ;
77
77
client . DefaultRequestHeaders . Authorization = authHeader ;
78
78
You can’t perform that action at this time.
0 commit comments