Identify server that made call to web service - sharepoint

I am working within an intranet environment. We have both a production and development sharepoint server (WSS 3).
We have a 3rd party workflow product which runs on top of sharepoint. It is installed on both the production and development sharepoint servers. The workflow product can call web services I have written which are hosted on our web server.
How would I have the web services determine which sharepoint server made the call to the web service, be it the production or development server?
I would then use this information to retrieve server specific information from web.config or database etc.
Currently the site hosting web services is setup to allow anonymous access so code such as
System.Web.HttpContext.Current.User.Identity.Name;
returns an empty string. If windows authenticaion is used it returns the identity of the currently logged in user, which is no use in identifying the server the call was made from.
I need a push in the right direction to address what I believe is probably a common scenario please.

Try System.Web.HttpContext.Current.Request.UserHostName

Related

Call SharePoint on-premises Data from a web application

I've developed a web application that interacts with Sharepoint Online sites via Microsoft Graph API, and everythings are going fine.
Recently, I received a request from a client telling me that he has Sharepoint on-premise and needs to consume my web app. Actually, I didn't know how to interact with a local Sharepoint. After much research, I discovered that Microsoft has many ways to interact with on-premise Sharepoint server like CSOM, JSOM, REST API, and many more.
The problem is all of them either are injected into Sharepoint like add-ins, or attached directly to the server, so no need for authentication.
Suppose I need to consume the Rest API. my case here resides in how to obtain the access token. How my online web app would interact with the local Sharepoint Server?
Thanks in advance

How do I setup SharePoint 2013 (On Premise) for third party apps?

I have created a provider-hosted app which was developed and tested against SharePoint Online. I now want to install this on SharePoint 2013 On Premise.
It is my intention that, despite being a provider hosted app, I wish to host the app web in IIS on the SharePoint server (single farm not a cluster). I then intend to use a local URL for my App Web URL.
I understand the process of setting up an App Catalog (On SharePoint Online) as a repository for my App which in turn will enable users to add it to a site.
I have only been able to find a guide to setup On Premise SharePoint to allow users to use the SharePoint store but I only want to set it up for third party apps.
My question is do I need to go through all the steps in this link https://technet.microsoft.com/en-gb/library/fp161236.aspx even if I don't want/require store access? I don't not want to do more than necessary and I would prefer a simple solution for my clients.
I followed this guide https://technet.microsoft.com/en-gb/library/fp161234.aspx in the hope that creating the app catalog would be sufficient but I get the error "Sorry, apps are turned off. If you know who runs the server, tell them to enable apps."

Self Hosting Web Application versus IIS Hosting?

I am in the process of building a Web based client for a Server application which is running as a Windows Service. The server application currently has a Windows Form based Client Application written in C# and the idea is to obsolete it and provide a new Web based Client Application. The Server application will be exposing REST based APIs and the Client Application would be using the REST APIs to communicate with the Server Application. (Currently the Server App exposes SOAP based endpoints which are consumed by the Windows Form Based App)
The Browser based client application would be written using Angular JS. The Client Application would be used by at max 10 concurrent users. The App is targeted for system administrators and would be used inside the enterprise environment.
Another requirement is to integrate Active Directory Authentication for the Client Application. So given the performance requirement and authentication requirements, I am wondering whether I should use IIS for hosting the Web Application. Or should I just use the existing Server to self host the web pages.
If at all I go with Self Hosting option, would Katana Self host be a good option? Or should i use WCF Rest kit to serve the pages?
What are the performance implications of using a Self Hosted mechanism for hosing the Web Application compared to IIS?
Any suggestion would be greatly appreciated.
WCF REST Starter kit is still in second preview 2 version from 2009 so I'd be pushed to recommend using it.
The question of IIS or self host depends, do you need the features that IIS has out of the box like logging, restart after failure, etc?
My suggestion would be to use ASP.NET Web API (or Nancy, which is an excellent choice too) but keep your hosting layer separate from your application layer so you have the flexibility to decide how you host your service later on.
The second suggestion is performance test early on, pick a hosting mechanism and measure how the service copes under load - you may find out that you're worrying about something that you don't need to.

Sharepoint 2013 Intranet and Extranet Topology - How?

I am currently trying to decide on a Sharepoint Farm Topology.
Currently (in terms of our needs), I think a simple three tier topology will work.
i.e.
Web Front-End Server
Application Server
Database server
To start with our primary aim will be to use SharePoint as a Intranet. However, on our roadmap we would like to extend some elements of this - as an Extranet with some coustomers.
Should we go with an Extranet option in the future, so do we just (in simple terms) create a new web application in Sharepoint 2013 on the existing web front end, sort out a host header and SSL and a means to manage permissions.
Or could we create a new front-end server, which is only houses a new web application (the Extranet) - but still uses the same Application and Database server (as it will be potentially sharing the some of the same content databases)?
I am primarily a C# Web Developer - which is typically how I view most things. As I am learning - in the world of SharePoint nothing is simple!
If the extranet users need access to the same content, you can stick with option 1 and and Extend the existing Webapplication for Extranet.

Creating Web Application in SharePoint with multiple Web front ends

How do you go about creating a web application in a Sharepoint server farm that has multiple Web front ends(identical ones for load balancing), especially if you creating it from command line? When you create it on one web server does it get automatically copied to other servers as well? Or do you have to extend the app to other servers?
As long as you play by SharePoint's rules you don't have to worry about the multiple Web front ends.
SharePoint will automatically make the changes on all of them (including future ones)
BUT if you go and make modifications in IIS manager or the filesystem (could be web.config) then you have to make these modifications to all Web front ends (also the ones you'll add in the future)
So always do all your modifications through Cdentral Admin, STSADM or the object model. And always use wsp packages when adding functionality
It's quite simple (in theory):
Install SharePoint
Add the server to the farm through Central Admin
This goes into a little more detail.
When you deploy new code/solutions to any one server, it will create a timer job that deploys to all servers in the farm. So, to answer your question, applications are deployed to the farm, not to servers.

Resources