How to work with Visual studio Team Services Oauth Model and what is the purpose of Azure - azure

I'm working with Visual Studio Online, and trying to use work with Oauth, which will allow me to use RESTFUL API of VSTS in my APP. How can I work. Please give a detailed answer, I'm confused.
One more thing is, while registering App in VSTS, there are two fields Application Website and Authorization Callback URL, which are making me more confused, what is the purpose of these two fields while registering App for Oauth.

First go read some documentation on Oauth and how it works.
On a high level, how does OAuth 2 work?
Then go read the documentation, which includes code examples, for VSO.
https://www.visualstudio.com/en-us/integrate/api/overview
Once you run into a specific issue, ask your question here with examples of what you tried.

i tried to use app for OAuth on my site. Got 400 Bad request on Visual Studio Online site everytime when code executed (user redirected to next URL from sample app):
return String.Format("{0}?client_id={1}&response_type=Assertion&state={2}&scope={3}&redirect_uri={4}",
ConfigurationManager.AppSettings["AuthUrl"],
ConfigurationManager.AppSettings["AppId"],
"state",
ConfigurationManager.AppSettings["Scope"],
ConfigurationManager.AppSettings["CallbackUrl"]
);
What`s wrong? Is there is some limitation for values in App registration page above?

Related

Excel WebApi Odata Authentication with Organisational Account

I have created an OData Service using .Net 6 / OData 8 and am trying to authenticate using Organisational Account in Excel. I can test the authentication sucesfully in Postman and also in my web App that uses the authenticated service.
However, if I try and create an OData Feed in Excel and authenticate using [Organisational Account], I get an error "We were unable to connect because this credential type isn't supported for this resource.".
Microsoft seems to indicate that it is not supported to connect to "arbitrary" services per the following link.
https://learn.microsoft.com/en-us/power-query/connectors/odatafeed#authenticating-to-arbitrary-services
However, this is a pretty big limitation and I'm interested to know if anyone has been able to solve this problem yet.
I won't go into the configuration of my web api, suffice it to say that I have tried every possible combination of builder.Services.AddAuthentication()..... that I can find and they all seem to have a similar issue - ie. I can use the WebApi for everything that I need it for - except Excel.
A quick Google search gets many, many hits (and I think that I have read them all - ..... twice), but try as I might I haven't yet found one that has an answer that works.
The following link showed some promise, which indicated it might be possible to change the audiencce, but I could not make it work.
https://www.c-sharpcorner.com/article/azure-odata-feed-web-api-authentication-setup-with-azure-ad/
I did find another promising link that I can't seem to find again that indicated we could add the Office 365 Client Id to the list of Authorised Client Applications under Expose an Api of the app registration in Azure AD B2C. I did that, with not success.
I'm really at my wits end on this and have been trying to get a solution on and off the last couple of weeks. Would really appreciate any help from others who might have tried and succeeded at this.
Confirming that I have now worked out how to do this and have posted the solution to the following SO thread. connecting-excel-to-oauth-api-on-azure
There are a number of steps to the solutions, so won't attempt to summarise them here.

Using Postman to test Web Api 2 with [Authorization]

Edit: I apparently need to fumble around just to realize what question I'm actually trying to ask..
I am using MVC5 and EF6 to build a local web application and am trying to test my web api 2s with Postman. I'm fairly new to http and ASP.NET and am wondering if there exists a tool to make api requests without too much authorization configuration. I understand that entity framework saves validation tokens in the browser, but I can't seem to find a good Chrome extension that will utilize the validation token to test CRUD operations before building out the UI to use them.
I should add this is a large practice project - I'm learning to swim in EF, not dependent on airtight security at this point.
I've tried following the instructions here:
ASP.NET Web API Authorization with Postman
but I can't seem to get Postman and IIS to get along.

How to connect WIX template with 3rd party REST APIs?

I created a simple web site using WIX platform. (https://www.wix.com/). I have some simple forms. Like customer registration and package management. All the UI part is done. And I have a Node.JS server to manage customers and packages. API is 100% done.
Now I need to connect WIX template with my NOde.JS REST API. Is there any possible ways to do this ?
My Node Server is deployed on a Ubuntu server and I can access it anywhere.
Please help me on this.
Yes, now Wix has this thing called Wix Code platform, which enables you to dynamically control your UI components and bind it to data coming from the outside.
To answer your question, they have this fetch API which you can use to write code to fetch your own server and get the data from it. Here is a link Wix Code API - fetch
Anyway, this is their site, Wix Code, you may learn a lot more there. Also they have those tutorials and examples of many "how to..." and examples Wix Code Tutorials and Videos
Cheers!

Azure AD B2C Authentication with Xamarin.Forms Not working

For almost a week now I have been trying to implement Authentication in a Xamarin.Forms(Android, iOS and Windows) Project to no avail. All the instructions and guides are either out of date, not clear or not functioning.
This Article from Xamarin was last updated in August 2016 while the MSAL has changed making this article obsolete. in this article they make use of PlatformParameters which has been replaced by UIParent.
This Example from Azure AD B2C documentation page from after implementing has UIRequiredException as calling AcquireTokenSilentAsync is not functioning since as at that time there is no user present.
This is getting really frustrating and would appreciate assistance or some step by step to implement this. All am trying to do is enable Authentication and Authorization for my Xamarin.Forms App and API Endpoint. Any pointer to good working code would be appreciated.
It would be helpful if there is an official updated guide or Video tutorial to help with this.
had exactly the same issue with using this project for a demo.
Use this version:
https://azure.microsoft.com/en-us/resources/samples/active-directory-b2c-xamarin-native/
It is the updated version with MSAL 2.4 preview. Its working on all samples/droid/ios/uwp
Here is a much fresher sample on how to get this done (as of June 20,2017 )
https://github.com/Azure-Samples/active-directory-b2c-xamarin-native
We have had issues with the same example. https://github.com/Azure-Samples/active-directory-b2c-xamarin-native
I have pretty much given up and I am looking at other solutions now.

how to write own logic without using qnamaker

I am still trying to understand Chatbots. Currently i have already made chatbot which is integrated in skype. I have Sharepoint online where user search for FAQ. If they dont find then they ask BOT which sends request to LUIS and Qnamaker.
Qnamaker then sends response back by looking it into its database. I upload FAQ from sharepoint to Qnamaker using sharepoint workflows. But i want to write my own logic and get rid of Qnamaker.
What are ways to do it? Any good tutorials? I also wanted to know how the flow happens. For example if we dont use Qnamaker then we fire queries in sharepoint based on what user asked? I dont understand how i can fire queries in sharepoint if user makes typo then we will not get anything from sharepoint. So any tips on how to implement this without using qnamaker is highly appreciated?
The FAQ bot generator is a subset of the main Microsoft bot framework. You should do some research on the Microsoft Bot Framework. The link above takes you right to the documentation overview of the bot framework and from there you can get into developing one. They have links to a few sample projects as well as a large number of code snippets within some of the article explanations. It has a full setup guide that will walk you through the initial setup so it should be easy to get a basic echo bot running, but if you are not a programmer you should stick to the FAQ generator.
I suggest you use either node.js or c# to develop the bot since these are directly supported by the framework. I am personally using c# to build my bot from the ground up. The purpose of mine is to be used within a customer facing android/ios app that will help with questions, checking the status of different things, and even paying bills.
Just remember you will need to manually set up your cloud hosting. I host mine in azure alongside a web interface I built for it (you can build the website inside your bot if you are using c#, just replace the default.htm file in the web.config with the main page of the interface).

Resources