FBA SP 2013 calling ChangePassword page from SP login page


#1

I added the pack at root site level and am trying to call a custom ChangePassword page I created or the layout ChangePassword page from my login page client side script that checks for password expiry and it does not seem to render anything besides a blank page. Suggestions?


#2

You sent me the following code:

int daysSincePwdChange = Convert.ToInt32(DateTime.Now.Subtract(usrInfo.LastPasswordChangedDate).TotalDays);
			if(daysSincePwdChange<DefaultPasswordExpiryInDays)
					FormsAuthentication.RedirectFromLoginPage (signInControl.UserName, false);
			else
				{
					FormsAuthentication.SetAuthCookie(signInControl.UserName, false);
					Response.Redirect("~/FBA-Admin/_layouts/ChangePassword.aspx?status=expired");
                                        // Response.Redirect("~/FBA-Admin/SitePages/ChangePassword.aspx");
				}
			}

I think there’s an issue with the redirect url, try using this:http://mysharepointwork.blogspot.com/2010/09/redirect-page-in-sharepoint.html


#3

Chris, still getting a blank page with the possibility of the password change web part being invisible using the SPUtility redirect. I am setting the auth cookie so I should be logged in.


#4

First check that you are being redirected to the correct url. Check it against the url you are redirected to when you use the change password menu item. Code for generating the url is here:

Second, looking at the code some more, I don’t think you’re authenticating correctly. See line 320 here:

The FormsAuthentication class doesn’t work with SP 2010+. SharePoint has it’s own claims authentication logic.


#5

I have this on the client side script now : SPUtility.Redirect(“FBA/ChangePassword.aspx”, SPRedirectFlags.Static | SPRedirectFlags.RelativeToLayoutsPage, HttpContext.Current);


#6

Chris, line 320 fixed it. You were right as usual :grinning:. Thanks a ton!