You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
-
This sample .NET MVC web app shows how to use the OAuth 2.0 capabilities in Visual Studio Online to prompt users to authorize your app and to acquire an access token and refresh token to access their Visual Studio Online resources.
1
+
# Visual Studio Team Services .NET OAuth Sample
2
2
3
-
To learn more about OAuth in Visual Studio Online, see [Authorize access with OAuth 2.0](http://www.visualstudio.com/integrate/get-started/get-started-auth-oauth2-vsi)
3
+
This sample .NET MVC web app shows how to use the OAuth 2.0 capabilities in Visual Studio Team Services to prompt users to authorize your app and to acquire an access token and refresh token to access their Visual Studio Team Services resources.
4
4
5
-
###Pre-requisities###
5
+
To learn more about OAuth in Visual Studio Team Services, see [Authorize access with OAuth 2.0](http://www.visualstudio.com/integrate/get-started/get-started-auth-oauth2-vsi)
6
6
7
-
These instructions assume you will be deploying this sample app to an Azure web site. To learn more and to get started, visit [Get started with Azure Web Sites and ASP.NET](http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-get-started).
7
+
## How to setup
8
8
9
-
###Setup###
10
-
1. Register an OAuth client app on Visual Studio Online (https://app.vssps.visualstudio.com/app/register) (note: the callback URL should be https://yoursite.azurewebsites.net/oauth/callback, where "yoursite" is the name of your Azure web site)
9
+
> These instructions assume you will be deploying this sample app to an Azure web site. To learn more and to get started, visit [Get started with Azure Web Sites and ASP.NET](http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-get-started).
10
+
11
+
1. Register an OAuth client app in Visual Studio Team Services (https://app.vssps.visualstudio.com/app/register)
12
+
* The callback URL should be https://yoursite.azurewebsites.net/oauth/callback, where "yoursite" is the name of your Azure web site
11
13
2. Clone this repository
12
14
3. Open the solution (VSOClientOAuthSample.sln) in Visual Studio 2013 (or later)
13
15
4. Update the following settings in web.config to match the values in the app you just registered:
@@ -16,20 +18,21 @@ These instructions assume you will be deploying this sample app to an Azure web
16
18
* Scope (space separated)
17
19
* Callback URL
18
20
5. Build (this will trigger a NuGet package restore, which will pull in all dependencies of the project)
19
-
6. Deploy the app.
21
+
6. Deploy the app to Azure
22
+
23
+
### Run the sample
20
24
21
-
###Run###
22
-
1. Navigate to the app (https://yoursite.azurewebsites.net)
23
-
2. Confirm your App ID, scope, and callback URL are showing properly (lower left)
24
-
3. Click the Start button
25
-
4. Sign in to Visual Studio Online (if necessary)
25
+
1. Navigate to the deployed app (https://yoursite.azurewebsites.net)
26
+
2. Confirm your App ID, scope, and callback URL are displayed properly
27
+

28
+
3. Click **Start**
29
+
4. Sign in to Visual Studio Team Services (if prompted)
26
30
5. Review and accept the authorization request
27
31
28
-
If everything is setup properly, Visual Studio Online will generate an access token and refresh token and both values will be displayed. **As an app developer, you would always keep these values secret**. Also a new authorization will appear on[your profile page](https://app.vssps.visualstudio.com/Profile/View).
32
+
If everything is setup properly, Visual Studio Team Services 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).
29
33
30
-
With this access token, you can call[Visual Studio Online REST APIs](http://www.visualstudio.com/integrate/reference/reference-vso-overview-vsi) by passing the access token in the Authorization header. For example:
34
+
With the access token you can invoke[Visual Studio Team Services REST APIs](http://www.visualstudio.com/integrate/reference/reference-vso-overview-vsi) by passing the access token in the Authorization header.FOr example:
0 commit comments