callbackurl while connecting to vso using oAuth - oauth

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.

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)

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

Related

Get Azure Active Directory token from an electron app

What would be the best way to obtain an AAD token from an electron app?
Microsoft has 2 javascript authentication libraries: adal.js and msal.js.
Both are designed for browsers and not native Electron apps (For example - AAD won't allow for file:/// scheme as a reply URL).
Sounds like a long term solution would be native AAD packages (like Microsoft built for Apache Cordova), but since that's probably not going to happen any time soon, what is the best short-term option?
Azure Storage Explorer is a good example of an Electron app that does this. It even allows for being logged into multiple AAD accounts at the same time.
You might be able to check out what's going on in the app's dev tools. I've had a poke around and it looks like it uses adal-node npm package instead of the browser based js libraries.
It also looks like it uses an authorization code flow for obtaining tokens.
The Azure AD doesn't support the file protocol as the reply address. To develop the single page application, you can host it on the server and using the server URL as the reply address.

Any way to access resource from ADAL.NET Library (native apps) on a web browser without having to do login activity again?

I am currently creating Universal Windows App (native) that uses Microsoft Graph API. For authentication, I used ADAL for .NET library by calling GetTokenAsync() on the AuthenticationContext (https://github.com/AzureAD/azure-activedirectory-library-for-dotnet). The library will automatically prompt a login window for the user to enter its credentials.
Later I was required to open a OneNote URL on a web browser. I managed to get the note URL from the Microsoft Graph API (OneNote API) and then I realized when I tried to open the URL on a browser I was redirected to the Microsoft login page (http://login.microsoftonline.com).
This is not very good for user experience because they needed to enter their credentials twice (on the ADAL prompt window and on the browser). Is there any way whatsoever so that the user can do the login activity only once?
User needs to enter their creds on Microsoft online website but not twice. please debug the app and store this context ticket so you can use it in your win universial app. by the way, make sure that you are not pointing your app to two different api endpoints. go with the Microsoft graph api endpoint but not any other legacy endpoint for your app. Hope this helps.

Retrive AppId in webservice from webconnector

My task is to integrate Quick Books 2015 enterprise with my web application. I created a web service to handle web connector call. I install web connector in client computer where Quick Books 2015 enterprise is running. I created a .qwc file to add application.
Everything is OK. I added a AppID in .qwc. I need to retrive AppID in any WebService method ie. authenticate etc. How can i get that?
QBWC client will push the username and password to you for authentication.
See https://developer-static.intuit.com/qbSDK-current/doc/PDF/QBWC_proguide.pdf for more information on QBWC.
AppID is not used and can be blank.

Unable to register the subscrition

I am new to Windows Azure.
I got a subscription to use Windows Azure, However i am not able to publish my sample web site.
The Error is,
This subscription not registered use to following resources: Website The remote server returned unexpected response(400). Bad request.
My question is, How to register the subscription?
Thanks in Advance!!!
Senthilnathan Kumarasamy.
I just encountered this issue.
What you need to do is to logon into the Azure web console and create a web site through by clicking:
New > Compute > WebSite > Quick Create.
Then from within Visual Studio when you try to publish your web app, you will see the account in the import wizard dialog.

Azure emulator web site is not visible by Facebook

My ASP.Net MVC3 web site that logs into Facebook is no longer working after moving to an Azure based cloud project. I am using the Azure SDK 1.6 and fail during the the OAuth steps.
I had a working site that ran locally at http://localhost:1200 which matched the Application Url setting that was registered for the application on Facebook. Now when I try to start the project in debug mode, it goes through the Azure emulator which maps the web site (role) to http://127.0.0.1:82/. I've tried updating the Facebook app url to the same address but it fails.
I've been investigating this and I've noticed that the Azure emulator automatically creates on the fly a new IIS web site and employs a load balancer for its created virtual IPs for the individual projects within the cloud solution. Is there a way to get a project to debug successfully and still talk to Facebook when running the Azure emulator within Visual Studio?
Any insight is greatly appreciated.
I would not use localhost for Facebook applications.
What I did, I had registered my real domain in Facebook (such as myapp.com)
Then I created a record in my hosts file (Windows\system32\drivers\etc\hosts)
127.0.0.1 dev.myapp.com
which is sub-domain of my production domain, so it's allowed by FB;
And then I used dev.myapp.com as callback address for Facebook; I also setup Visual Studio to run http://dev.myapp.com:anyport on start application debugging.

Resources