views:

1626

answers:

2

I have an ASP.NET home page where user provides his login ID. Depending on the application (SharePoint Site) the ID is associated to- the user is directed to the respective sharepoint site.

For example, if user is site1user, the ASP.NET page directs the user to sharepointsite1.

I got it working this far.

Now, how do I pass the login ID from ASP.NET to the SharePoint login page so that the user need not type in user ID again.

I tried URL parameter passing. But it didn't work.

A: 

You need to customize the login.aspx page and write the code that will fetch the ID from the Query String and set it to the user name text box.

Kusek
SharePoint is using a virtual directory for all its pages. Do you think I should make a copy of folder and give its path to sharepoint app- so that I can customize this app?
SQL Baba
No Just make a Copy of login.aspx to something mylogin.aspx, do the code in the file. And in the web.cofig file Authentication tag change the loginurl to mylogin.aspx. Its not a good practice to touch any of the file used by sharepoint. Its not supported.
Kusek
SQL Baba
Kusek
kusek, can i share fba between asp.net and sharepoint even if users come from multiple applications?right now asp.net app is just reading the username and redirecting the users. * usernames across all sharepoint sites are unique.
SQL Baba
I didnt get your question. But let me explain how FBA works, in FBA there is something called ApplicationName which is a Base that is used to identify the scope of the user and Roles. For example lets assume your application name is XYZ and you have a User called admin, and you will not be able to create another user with the same name, but you can have user admin in another application ABC. Being said that, you can share Same FBA application NAme with any number of applications (But you should have a strong reason to do that). For the above case you can Share FBA.
Kusek
+1  A: 

If you're using forms-based authentication (FBA) in your ASP.NET application you can also configure SharePoint to use FBA too and get SharePoint to use the same FBA configuration as your ASP.NET application.

The benefit of doing this is that you can have a user login to your ASP.NET application and simply redirect them to their SharePoint site and they'll be logged in automatically. You don't have to pass the username to SharePoint in any way or customize any pages. It can be a little tricky configuring FBA in SharePoint if you haven't done it before but these resources should help:

dariom
dariom,i'm comfortable configuring fba in sharepoint. however:right now the asp.net application just serves as an entry point. it doesn't authenticate the user. it just redirects the user to appropriate sharepoint site. it is one central redirect page for many sharepoint applications.right now user is not authenticated until she is authenticated through their respective sharepoint site.all my asp.net application doing right now is that it identifies the sharepoint application url from database and redirect the user to the URL. *each application in db has it own application id.
SQL Baba
Hi SQL Baba. OK I understand better now. Right now your users go through 3 steps: 1: visit ASP.NET site and enter login ID. 2: redirect to SharePoint site. 3: log in to SharePoint site. If you're using FBA shared between ASP.NET and SharePoint you could improve the user experience by getting them to log into the ASP.NET application first and then redirecting them to SharePoint. They wouldn't have to log into SharePoint and you eliminate step 3 in your process. Just a thought :-)
dariom