Monday, February 28, 2011

Rename SP webapplication host header

1. Use F5 or any external load balancing hardware to setup redirection between old hostheader and new host header using i-rules.
2. Using AAM (Alternate Access Mappings) on sharepoint side.

Link,
http://www.jeremytaylor.net/2009/05/17/host-headers-for-sharepoint-rename-web-application/

Sunday, February 27, 2011

Configure LiveID SP 2010 federated authentication

http://blogs.msdn.com/b/hsalvi/archive/2010/09/01/configuring-windows-live-id-authentication-provider-as-federated-identity-provider-for-sharepoint-2010.aspx

Custom login webpart SharePoint 2010 FBA Claims Internal 500 error Signout

Reference
http://blogs.msdn.com/b/jjameson/archive/2011/02/25/claims-login-web-part-for-sharepoint-server-2010.aspx

Steps
1. Configure FBA (web.config, web application settings) on SP 2010 farm

2. Create a VS 2010 SP Visual webpart

3. Add asp:login control.
" OnAuthenticate="AuthenticateUser"
runat="server" >

4. OnAuthenticate event handler,

string membershipProvider = "aspnetmembershipprovider";
string roleProvider = "aspnetroleprovider";

e.Authenticated = SPClaimsUtility.AuthenticateFormsUser(
new Uri(SPContext.Current.Web.Url),
LoginControl.UserName,
LoginControl.Password);

if (!e.Authenticated) return;

SecurityToken secTk = SPSecurityContext.SecurityTokenForFormsAuthentication(webUri, membershipProvider, roleProvider, LoginControl.UserName, LoginControl.Password);
if (secTk == null)
{

e.Authenticated = false;
return;
}
else
{

SPFederationAuthenticationModule fam = SPFederationAuthenticationModule.Current;
fam.SetPrincipalAndWriteSessionToken(secTk);
e.Authenticated = true;

SPUtility.Redirect(SPContext.Current.Web.Url,SPRedirectFlags.Trusted , this.Context);

}

5. Deploy code.

6. Add webpart to content page.

7. Set content page as default login page under web application authentication settings for FBA

8. Make sure webapplication and site collection have annonymous turned ON.

9. Test by navigating to home page of site collection. It should auto-redirect to content page with login webpart.

10.Test login with aspnetdb user login and password information.

6. Once user is logged in, click ootb Signout button and no INTERNAL 500 ERROR should occur, it should successfully navigate to login content page.

Post comments if you have questions.

Saturday, February 26, 2011

SP 2010 FBA Configuration Detailed.

http://blogs.msdn.com/b/alimaz/archive/2009/10/30/configuring-fba-in-sharepoint-server-2010-beta-2.aspx

ASP.Net membership usage

http://msdn.microsoft.com/en-us/library/ff648345.aspx

Configure ftp with asp.net membership

http://learn.iis.net/page.aspx/389/configuring-ftp-with-net-membership-authentication/

Custom login page for SP 2010

http://blogs.technet.com/b/speschka/archive/2010/07/21/writing-a-custom-forms-login-page-for-sharepoint-2010-part-1.aspx

http://jsiegmund.wordpress.com/2010/05/20/sp2010-creating-a-mixed-mode-login-page-for-claims-based-authentication/