Access Sharepoint List on another ASP Application - asp.net

Is is possible to access a sharepoint list into my asp application which is to be deployed on another server? If yes, please share your thoughts.
I have tried using rss reader (jquery plugin) and xml reader of asp but it's not working.

my solution is to access the SharePoint list using a service account that has administrative permission on the list.

Related

Creating separate pages for each account ASP.net WEB API project

I am new to web API and I am not sure whether it is possible in Web API.
I have an application where I need to create a page for each user of my website. Means if there is a user named JOHN, I need to create a page named www.mysite.com/john.
How can I achieve it.
Thanks in advance

ASP.NET ADFS authentication to access sharepoint

I want to build an application to access sharepoint website. First I have created a login form..
I want to authenticate via ADFS How to do that from my website.
How to access the sharepoint utilities after logged in.
That's it. I just want to show the files/documents at my website.
Please share me links or sample if any one have. If available in MVC then no problem.
Thanks in advance.
As you want to display SharePoint List/Library data in your own application/website, so in this scenario, there are two approaches:
Approach 1
Use RSS feeds to embed SharePoint Data into your Application/Website. You can use any RSS Feed viewer for your application.
Approach 2
You can use SharePoint Client Object Model (CSOM). Using CSOM you can get data from SharePoint Environment and use the data to embed in your application.
Here is a reference link to get familiar with CSOM :
https://msdn.microsoft.com/en-us/library/office/fp179912.aspx
Hope these details will help you.

How to get SharePoint Site authentication information to use it in an ASP.NET website which is integrated inside that SharePoint Site?

I have integrated my ASP.NET website into a SharePoint Site by using an IFrame in the SharePoint Page via a Content Editor Web Part. The ASP.NET web application doesn't have any authentication & authorization implemented in it.But the SharePoint site is having some authentication implemented. Now my requirement is how to get and use that SharePoint authentication information in my ASP.NET web application programmatically to do some code manipulations based on the authenticated user level.Any help would be appreciated.Thanks in Advance
The 'Right' way of doing it would be to redevelop your site as a collection of Application pages. This allows you to limit permissions to Site Collection Administrators, or just about any level of SharePoint Authentication.
http://msdn.microsoft.com/en-us/library/Ee231581(v=vs.100).aspx
This allows you to use the SharePoint object model directly in your 'web' application.
It's a bit complicated to shift from a traditional web application to getting all the pieces running under the Sharepoint _layouts folder, but its worth the time spent and pretty easy to update.
It should be noted that your existing IIS website would be removed and the pages re-homed to that layout folder, via a SharePoint Feature containing your application pages.

Open Sharepoint Application Page inside ASP.Net web app

I have the unusual situation to solve... There is a application page that runs inside SharePoint 2010 with a form to upload some file to a Document Library.
The thing is that this application page needs to be showed on a modal inside my ASPX web app.
I got this running using simplemodal jquery plugin running inside a iframe.
My question is... how can I achieve this functionality considering security questions like a controlled access to this application page? My SharePoint site does not allow anonymous access so I need to figure out how to allow public access only on this page.
I would re-create the page in this asp.net application and then communicate with sharepoint using the client object model or perhaps another approach such a custom webservice (but client model should be ok). I would say that this is the only clean way to achieve your goal.

Displaying the current authenticated Sharepoint user from an asp.net Page Viewer Web Part

I am creating a standalone asp.net page that needs to be embedded into a sharepoint site using the Page Viewer Web Part. The asp.net page is published to the same server on a different port, giving me the URL to embed.
The requirement is that after a user is authenticated using Sharepoint authentication, they navigate to a page containing the asp.net web part for more options.
What I need to do from this asp.net page is query Sharepoint for the currently authenticated username, then display this on the page from the asp.net code.
This all works fine when I debug the application from VS, but when published and displayed though Sharepoint, I always get NULL as the user.
Any suggestions on the best way to get this to work would be much appreciated.
If you want to retrieve the currently authenticated user from the SharePoint context, you need to remain within the SharePoint context. This means hosting your custom web application within SharePoint (see http://msdn.microsoft.com/en-us/library/cc297200.aspx). Then from your custom application reference Microsoft.SharePoint and use the SPContext object to retrieve the user name. For example:
SPContext.Current.Web.CurrentUser.LoginName
You can still use the Page Viewer Web Part to reference the URL of the site, now located within the SharePoint context.
Thanks heaps for the answers!
Turns out that as long as the asp.net page is using the same URL and port as the Sharepoint site, authentication works across both sites.
The solution is to use a Virtual Directory inside of the sharepoint site and install the asp.net page there.
When it works in debug, is that being used in SharePoint?
Your page and the Sharepoint site might as well be on different servers as far as authentication is concerned -- in order to get the information over you might need to pass it via the QueryString from the webpart if you can -- or you might need to make your own webpart to do this (just put an IFRAME in the part with the src set to your page with the QueryString passing the username).
It does seem that this would be a security issue if you use the name for anything though -- if you are just displaying it, then it's probably fine.
If you actually need to be authenticated, you might need to add authentication into the web.config of the site hosting your standalone page.
edit: I think you'd have better luck putting your page on the same port and server as SharePoint.
I suspect you will have a hard time specifically querying SharePoint for the currently authenticated username. I can't think of a way to easily access the SharePoint context from a separate web application like you are describing.
I don't know what kind of authentication scheme you are using, but you may want to consider using Kerberos, as I've found that it can make these kinds of scenarios a little easier by allowing for delegation and passing credentials from application to application or server to server.

Resources