Showing posts with label FBA. Show all posts
Showing posts with label FBA. Show all posts

Monday, March 14, 2011

SharePoint FBA Error

Was getting this error
The password-answer supplied is invalid

added:

enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
/>

FBA SharePoint error

"A Membership Provider has not been configured correctly. Check the web.config setttings for this web application"

changed applicationName="/" to applicationName="???"

This broke everything

FBA can be configured for multiple applications, changing the applicationName has far reaching consequences, especially when restoring

How to connect to Excel Services with FBA

Lets say you have a site that uses forms based authentication, like an internet facing site. And then lets say that you are using Excel Services on the same farm.

So what you need is to make a cookie:

ExcelWebService.ExcelService excelService = new ExcelWebService.ExcelService();
debugWriterOutput("eService: " + excelService.Url);

excelService.CookieContainer = new CookieContainer();
excelService.CookieContainer.Add(Utilities.FBACookieAuthentication(excelService));

ExcelWebService.Status[] status;





internal static Cookie FBACookieAuthentication(ExcelWebService.ExcelService excelServiceSoapClient)
{
Authentication.Authentication auth = new Authentication.Authentication();
auth.CookieContainer = new CookieContainer();

LoginResult result = auth.Login("LoginName", "Password");

CookieCollection cookies = auth.CookieContainer.GetCookies(new Uri(auth.Url));

Cookie authCookie = cookies[result.CookieName];

return authCookie;
}