callbackurl while connecting to vso using oAuth

Deadly 提交于 2019-12-25 12:44:09

问题


I am trying to connect to VSO using oAuth. First step is to register our app and configure a call back url. I am creating a console application to test the connectivity. Please let me know how to configure the callback url.


回答1:


Firstly, please take note that: Right now, it is only supported to register web application, it is impossible to register a console app.

So, you need to have a web app first, you can download and use this sample project for a quick start: https://vsooauthclientsample.codeplex.com/

After you download the app, open it in VS2013 or higher, right-click it in Solution Explorer and select Publish.

On the Publish Web page, select Microsoft Azure Website option to publish that web app to Azure.

Then, the web app is published to Azure with the URL similar to: https://vsodevabc.azurewebsites.net

And when you register this web app, you can set Application Website and Callback URL to be the followings. (note: the callback URL should be https://yoursite.azurewebsites.net/oauth/callback, where "yoursite" is the name of your Azure web site)




回答2:


When using VSO (now called Team Services) with oAuth2.0 you do have to provide callback url endpoint that Microsoft's Team Services can call directly. So you need to have your application's callback url endpoint published such as publishing to Azure or Aws or any hosting provider that will allow you to have publically accessible url. In the FAQ under Team Services Rest API, there is mention of this approach for debugging purposes:

Visual Studio Team Services does not allow localhost to be the hostname in your callback URL. You can edit the hosts file on your local computer to map a hostname to 127.0.0.1. Then use this hostname when you register your app. Or, you can deploy your app when testing to a Microsoft Azure website to be able to debug and use HTTPS for the callback URL

Visual Studio Team Service's Rest API oAuth



来源:https://stackoverflow.com/questions/32603820/callbackurl-while-connecting-to-vso-using-oauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!