Skip to content

Commit 2f31a70

Browse files
Merge pull request #26 from Microsoft/users/jmarks/RemoveNetCore
Remove .netcore 2
2 parents 665e538 + 2ef123c commit 2f31a70

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

ManagedClientConsoleAppSample/ManagedClientConsoleAppSample.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFrameworks>net452</TargetFrameworks>
5-
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
65
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
76
<RootNamespace>ManagedClientConsoleAppSample</RootNamespace>
87
<AssemblyName>ManagedClientConsoleAppSample</AssemblyName>

ManagedClientConsoleAppSample/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ public static void Main(string[] args)
2323
AuthenticationContext ctx = GetAuthenticationContext(null);
2424
AuthenticationResult result = null;
2525

26-
IPlatformParameters promptBehavior = new PlatformParameters();
27-
#if NET452
28-
promptBehavior = new PlatformParameters(PromptBehavior.Always);
29-
#endif
26+
IPlatformParameters promptBehavior = new PlatformParameters(PromptBehavior.Always);
3027

3128
try
3229
{
33-
3430
//PromptBehavior.RefreshSession will enforce an authn prompt every time. NOTE: Auto will take your windows login state if possible
3531
result = ctx.AcquireTokenAsync(azureDevOpsResourceId, clientId, new Uri(replyUri), promptBehavior).Result;
3632
Console.WriteLine("Token expires on: " + result.ExpiresOn);

OAuthWebSample/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,5 @@ $RECYCLE.BIN/
164164
storage*
165165
db.lock
166166
*.pubxml
167+
168+
.vs/
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
@{
2-
ViewBag.Title = "Visual Studio Team Services OAuth Client Sample";
2+
ViewBag.Title = "Azure DevOps OAuth Client Sample";
33

44
var missingMsg = "Not set - update web.config";
55
var clientAppIdVal = !String.IsNullOrEmpty(ViewBag.ClientAppId) ? ViewBag.ClientAppId : missingMsg;
66
var scopeVal = !String.IsNullOrEmpty(ViewBag.Scope) ? ViewBag.Scope : missingMsg;
77
var callbackUrlVal = !String.IsNullOrEmpty(ViewBag.CallbackUrl) ? ViewBag.CallbackUrl : missingMsg;
88
}
99

10-
11-
1210
<div class="jumbotron">
13-
<h1>Visual Studio Team Services OAuth Client Sample</h1>
14-
<p class="lead">This app shows how to authorize a user to authorize an app and then to request an access token to access Visual Studio Team Services on their behalf.</p>
15-
<p><a href="@Url.Action("Authorize", "OAuth")" class="btn btn-primary btn-large">Authorize &raquo;</a></p>
11+
<h1>Azure DevOps OAuth Client Sample</h1>
12+
<p class="lead">This app shows how to authorize a user to authorize an app and then to request an access token to access Azure DevOps on their behalf.</p>
13+
<p><a href="/oauth/requesttoken" class="btn btn-primary btn-large" >Authorize &raquo;</a></p>
1614
</div>
1715

1816
<div class="row">
@@ -21,7 +19,7 @@
2119
<p>
2220
Before you start, make sure to:
2321
<ol>
24-
<li><a href="https://app.vsaex.visualstudio.com/app/register">Register</a> a client app with Visual Studio Team Services</li>
22+
<li><a href="https://app.vsaex.visualstudio.com/app/register">Register</a> a client app with Azure DevOps</li>
2523
<li>Update the web.config of this web app and set the App ID, Scope, App Secret, and Callback URL set in the registered app. The callback URL should be https://<i>site</i>/oauth/callback
2624
<ul>
2725
<li>App ID: <strong>@clientAppIdVal</strong></li>
@@ -33,8 +31,8 @@
3331
</p>
3432
</div>
3533
<div class="col-md-4">
36-
<h2>Learn about auth in Visual Studio Team Services</h2>
37-
<p>Visual Studio Team Services support authorization via OAuth 2.0. Learn more about how you can develop apps that securely access your user's Visual Studio Team Services projects and perform tasks on their behalf.</p>
38-
<p><a class="btn btn-default" href="https://docs.microsoft.com/vsts/integrate/get-started/authentication/oauth?view=vsts">Learn more &raquo;</a></p>
34+
<h2>Learn about auth in Azure DevOps</h2>
35+
<p>Azure DevOps supports authorization via OAuth 2.0. Learn more about how you can develop apps that securely access your user's Azure DevOps projects and perform tasks on their behalf.</p>
36+
<p><a class="btn btn-default" href="https://docs.microsoft.com/en-us/vsts/integrate/get-started/authentication/oauth?view=vsts">Learn more &raquo;</a></p>
3937
</div>
4038
</div>

OAuthWebSample/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This sample shows how to prompt a user to authorize a cloud service that can cal
44

55
To learn more about OAuth in Azure DevOps, see [Authorize access to Azure DevOps with OAuth 2.0](https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=vsts)
66

7+
78
## How to setup
89

910
> These instructions assume you will be deploying this sample app to an Azure web app. To learn more and to get started, visit [Get started with Azure Web Apps and ASP.NET](https://docs.microsoft.com/azure/app-service/app-service-web-get-started-dotnet-framework).
@@ -38,6 +39,7 @@ To learn more about OAuth in Azure DevOps, see [Authorize access to Azure DevOps
3839

3940
If everything is setup properly, Azure DevOps will issue an access token and refresh token and both values will be displayed. **You should keep these values secret**. Also a new authorization will appear in [your profile page](https://app.vssps.visualstudio.com/Profile/View).
4041

42+
4143
With the access token you can invoke [Azure DevOps REST APIs](https://docs.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-4.1) by providing the access token in the Authorization header.
4244

4345
```

0 commit comments

Comments
 (0)