Granting Cognitive Services Face API access to a sharepoint folder - microsoft-cognitive

I have a flow that stores a photo to sharepoint and then passes the url for this image to Face API preview connector in flow.
I currently get a "forbidden" error, which makes sense as the face api does not have access to the sharepoint location.
How do i grant the face api access to a sharepoint location to see all files in a folder?

For now, there is no built-in mechanism for Azure Cognitive connector to access SharePoint, you could check this feedback Nicolas R shared no indexer for Sharepoint documents.
So you could use SharePoint connector to get the file directly and pass the file content to the face API connector.

Related

Microsoft workdflow custom connector

I am trying to develop a simple customer connector for my website on microsoft flow and so far I can't see how to use a web API that is hosted on my website every article tutorial I am coming by require APIs to be hosted on Azure, also an Azure account is a prerequisite .. is it true Only azure APIs to be used for custom connectors ?
Azure is not a prerequisite for Custom Connector. I agree that most of the tutorials talk about connecting Azure hosted apps.
Microsoft flow currently supports creating custom connector with Swagger API output or postman exported data. I created a Postman collection with the API and gave the exported data as input to Microsoft flow for creating the connector.
Detailed Tutorial is available here
https://flow.microsoft.com/en-us/documentation/postman-collection/
I have the same issue, I have configured a custom connector for testing to go against this test / mock API
POST -> https://jsonplaceholder.typicode.com/posts
In the connector test it keep on hitting this URL:
https://msmanaged-na.azure-apim.net/apim/zoom.2dtest.2d002.5f43ed1d930148619c.5f4fd64f4beaca2b60/51136e9557bf4e128e0d7552ff624ebd/posts
I have never configure it to go there. No document explains how or why this would happen.

What is a web script? How it is different from RESTFul web services?

I came across this terminology while working with Alfresco. Is web script a type of RESTFul web services?
Web scripts provide a unique way to interact with the Alfresco repository. With help of web script one can search or access contents within alfresco repository. It's basically a RESTful web service. Alfresco provides REST architecture based framework for web script. It is a simple service bound to a URI and based on HTTP.
For more details

How can use Box.API with Asp.Net web service?

I have used asp.net(c#) web service for my project. I am calling save file function from front end adobe flex environment. My files are exists on web service folder.
My web application is an intranet application and currently used google docs api for uploading and retriving files for the project.
Now i want to use service of box.com and using box.com api, i want to upload and download the files.
Question: In google docs api, i have generated authorization code using login credential that will help to create token and using this token help me to upload files , download files and create/update/Delete folders.
How can i will do same for the box.com api ?
How can i will authorized and create token in my web services ?
Have you taken a look at:
https://github.com/box/box-windows-sdk-v2
The SDK supports .NET version 4.0 and up. For ease of installation, try pulling the package from nuget.org:
http://www.nuget.org/packages/Box.V2/
Examples are available in the readme as well as in the Box.V2.Samples solution folder
HTH

Authentication using OAuth in Web API

I'm working on a project using ASP.Net MVC5 which also includes a Web API. The API will be for internal use only. I'm using the OWIN library to provider authentication.
I'm having a difficult time figuring out how to correctly implement authentication through the API. I was planning on using OAuth 2.0 but the problem with OAuth is that the user needs to login through a browser page instead of a native login screen. So I was wondering if it is possible to somehow skip the browser.
I've found this example which creates it's own OAuth Authorization Server. But it doesn't show how to make the login native.
If it's a highly trusted client, then you can use the OAuth2 resource owner password flow. You can look at the VS2013 SPA template and/or read on this post:
http://leastprivilege.com/2013/11/13/embedding-a-simple-usernamepassword-authorization-server-in-web-api-v2/
You could use Thinktecture.IdentityServer v2 as a light-weight security token service.
https://github.com/thinktecture/Thinktecture.IdentityServer.v2
You will need to create a WOPI host, which is basically a software solution that can take advantage of the browser-based Office(office web).
Create a custom WOPI host and configure it to use Office Web Apps Server to provide the browser-based file viewing and editing for Office files.
Nice sample on Microsoft MSDN

How to use SharePoint only as a Content Management tool from a custom web application?

We have many custom built web applications (both external & internal) written in Classic ASP and ASP.NET 2.0 technologies. Internal users can upload files to these websites, which can then be viewed by External Users. In some cases, external users can upload documents as well.
Screenshot #1 gives a brief idea about the existing architecture.
Internal users upload documents to custom web applications. These documents are stored in a folder structure defined under the web application.
Meta data and user permissions like who can access the documents are stored in SQL Server database.
The same set of documents that are being uploaded to custom web applications also exist in SharePoint. However, the custom web applications are unaware of SharePoint. So, users have to download them from SharePoint and then Upload it to the custom web applications. We are currently using SharePoint 2010.
External users can also upload documents to the custom web applications. The meta data and user permissions of the document are saved into database based on the user who is uploading the document.
Screenshot #1:
Screenshot #2 shows the architecture that I am trying to achieve. I have done very little SharePoint development. Mostly, I have used the SharePoint web services to retrieve some list content but nothing more than that. Our future Custom Web Applications might be written using ASP.NET MVC. Please find the questions after the screenshot.
Screenshot #2:
Here are my questions:
I would like to have internal users continue to upload and maintain their documents in SharePoint. User security model is already defined in the SQL Server database. This security permissions should be available in the SharePoint document properties so users can choose who can view the document from the custom web applications. How can I achieve this? Should I have to copy the SQL Server user permissions info to SharePoint?
I believe that SharePoint Web Services or Business Connectivity Services (BCS) can help in retrieving the document and its related info from SharePoint. Which one of these would better suit this scenario?
Custom web app should display only the committed versions of the documents. If a user has checked out a document in SharePoint to make any changes, that checked out version of the document should not be visible to External users. Is that possible?
Has anyone tried this approach? Are there any pitfalls with this model? Are there any performance concerns with this design?
Will this design be of any hindrance if I rewrite our existing applications using ASP.NET MVC?
Is it possible to make use of SharePoint search feature within the custom web application (ASP.NET Web Forms / ASP.NET MVC)? In other words, can I send search criteria from custom web app and have SharePoint do the search and return the results back to custom web app?
I really appreciate your inputs.
Thanks in advance.
Question 1
Hard to say without having more details. So I'm going to assume that you currently use Active Directory for your authentication store. So this means that your SQL Server defines a list of roles and then has assigned memberships to these roles. I'm going to assume that your assigned membership is to AD users or groups. If this is true then I think your on the right path to push your permissions from SQL Server into SharePoint. SharePoint's API will accommodate what you need to do, however SharePoint has no built into mechanism for syncing your permission changes so that means you end up writing a whole lot of plumbing code. I would recommend that you research products that can handle the synchronization for you. Microsoft MIIS (I believe it is called Forefront Identity Management now) offer a set of architecture patterns that you should investigate.
Question 2
SharePoint Web Services or the SharePoint Client Access Services should work fine. I would highly recommend that use a proxy pattern to isolate your application from SharePoint calls (so you can isolate your application from SharePoint upgrades and potential content management server changes).
Question 3
Yes, that is possible. If you are using the publishing features of SharePoint Server (NOT SharePoint Foundation) you will have an easy way of identifying the current published version. Otherwise the service account you query with should be setup so it can only read published versions then SharePoint will automatically trim your query.
Question 4
I have not personally tried this design, but I really like the concept of creating a content management domain and then putting an abstract service layer on top of it. Will you have scale problems, depends on how you configure SharePoint and your applications. You can do it right or wrong. An depth answer between the two cannot be covered here. My one piece of advice is to make sure you plan for caching in your service interfaces (cache, cache, cache).
Question 5
Not if you implement it as a Service Layer. You would just use a repository pattern to call the service and return back entities for your model.
Question 6
Yes, Search is exposed via an API so it can be wrapped in a service layer too.
Good luck and feel free to contact me directly for more in depth discussion.

Resources