- Oct 30, 2000
- 14,665
- 440
- 126
Okay, I am trying to create a custom login page for a 2010 site. First off, I'm practically doing every thing in regards to this site but still have to work with certain configurations.
Let me step through what I have done thus far and what we have setup. The initial server and settings I did not do. So I've had to go back in and reconfigure quite a bit to get Forms Based Authentication with Active Directory working.
As far as the basic configuration goes I have a Sharepoint 2010 server and a separate Active Directory server. I configured my Sharepoint server to use FBA with active directory following this page.
http://blogs.msdn.com/b/sridhara/ar...ith-active-directory-membership-provider.aspx
Basically I removed all the other member providers that someone else had screwed around with in the various web configs. Found out some of those weren't setup right and causing problems. So I modified the central admin web config as well as the security token web config and the site I am going to put the custom login in page web config. All have the proper active directory server connection string and membership provider creation using that connection string.
I configured the site off the port I want to use to use FBA and call upon the active direct member provider I setup in the web configs. I also set up the people picker wild card for the membership as well.
All that is now hunky dory now, but it took several days to get everything working for just that. Mainly because I had zero idea initially what I was doing and how to do all that. So great learning experience.
I came across two different ways through the magic of the internet to implement a basic forms custom login page. I created Visual Studio projects for both and tried them both. Both work, but are very basic.
Now there is where I'm stuck. My requirement is to use this custom login page to deal with password expiration of accounts from active directory. I can't find jack for info on how to do this or even where to start.
Here are the two ways I saw to create a custom login page.
1) http://www.mssharepointtips.com/tip.asp?id=1093
This site shows how to create a basic forms page that extends out System.Web.UI.Page which is the layout base page. With this version, no sharepoint master page is used. This is handy for debugging on my site as I don't have to do the normal login first then direct myself to the page Visual Studio deploys to test my login page.
This page reacts of the Login_Click button and uses the SPClaimsUtility to authenticate through FBA and the AD linked to it the user name and password typed in. For basic authentication and having a security cookie generated to log into the site this works.
AND this is the second way I tried
2) http://davidlozzi.com/2011/07/15/sh...e-login-page-with-forms-based-authentication/
This site shows how to create a custom login page by using the basic simple master page and extending out the FormsSignInPage class. This page uses default functionality built into the wss resources for authenticating the user. Truth be told I am not exactly sure how this page works but it does. The problem is that since this page uses the master page it makes debugging a bit more difficult. If I build in debug mode and use Visual Studio to deploy to run in debug mode, I have to log in normally first, then navigate to the /_layouts/MyProjetFolder/Mypage.aspx (or whatever I have named things) to view the login page I created. This does work, just more of an annoyance compared with the first way.
However, I am not sure where to proceed from here. What I want to do is not redirect the user after authenticating them. First, I want to see how long before their password expires. Or if authentication failed, check to see if the failure was from an expired password. Then if need be redirect the user to another page to change/update their password. I also want to grab some additional meta data stored in Active Directory about the user trying to login such as their email address and group so I can redirect them to certain default login pages for that user.
Anyone know what I should do to proceed from here?
Let me step through what I have done thus far and what we have setup. The initial server and settings I did not do. So I've had to go back in and reconfigure quite a bit to get Forms Based Authentication with Active Directory working.
As far as the basic configuration goes I have a Sharepoint 2010 server and a separate Active Directory server. I configured my Sharepoint server to use FBA with active directory following this page.
http://blogs.msdn.com/b/sridhara/ar...ith-active-directory-membership-provider.aspx
Basically I removed all the other member providers that someone else had screwed around with in the various web configs. Found out some of those weren't setup right and causing problems. So I modified the central admin web config as well as the security token web config and the site I am going to put the custom login in page web config. All have the proper active directory server connection string and membership provider creation using that connection string.
I configured the site off the port I want to use to use FBA and call upon the active direct member provider I setup in the web configs. I also set up the people picker wild card for the membership as well.
All that is now hunky dory now, but it took several days to get everything working for just that. Mainly because I had zero idea initially what I was doing and how to do all that. So great learning experience.
I came across two different ways through the magic of the internet to implement a basic forms custom login page. I created Visual Studio projects for both and tried them both. Both work, but are very basic.
Now there is where I'm stuck. My requirement is to use this custom login page to deal with password expiration of accounts from active directory. I can't find jack for info on how to do this or even where to start.
Here are the two ways I saw to create a custom login page.
1) http://www.mssharepointtips.com/tip.asp?id=1093
This site shows how to create a basic forms page that extends out System.Web.UI.Page which is the layout base page. With this version, no sharepoint master page is used. This is handy for debugging on my site as I don't have to do the normal login first then direct myself to the page Visual Studio deploys to test my login page.
This page reacts of the Login_Click button and uses the SPClaimsUtility to authenticate through FBA and the AD linked to it the user name and password typed in. For basic authentication and having a security cookie generated to log into the site this works.
AND this is the second way I tried
2) http://davidlozzi.com/2011/07/15/sh...e-login-page-with-forms-based-authentication/
This site shows how to create a custom login page by using the basic simple master page and extending out the FormsSignInPage class. This page uses default functionality built into the wss resources for authenticating the user. Truth be told I am not exactly sure how this page works but it does. The problem is that since this page uses the master page it makes debugging a bit more difficult. If I build in debug mode and use Visual Studio to deploy to run in debug mode, I have to log in normally first, then navigate to the /_layouts/MyProjetFolder/Mypage.aspx (or whatever I have named things) to view the login page I created. This does work, just more of an annoyance compared with the first way.
However, I am not sure where to proceed from here. What I want to do is not redirect the user after authenticating them. First, I want to see how long before their password expires. Or if authentication failed, check to see if the failure was from an expired password. Then if need be redirect the user to another page to change/update their password. I also want to grab some additional meta data stored in Active Directory about the user trying to login such as their email address and group so I can redirect them to certain default login pages for that user.
Anyone know what I should do to proceed from here?