Hi,
how do I go about calling Credentials.SetCredentials () from a web page?
I've tried the obvious way, and I get the error "Error in the
application", with the LastErrorCode of
SSOReturnCodes.SSO_E_CANARY_VALIDATION_FAILURE and the stack trace:
Microsoft.SharePoint.Portal.SingleSignon.SingleSignonException: Error in
the application.
at Microsoft.SharePoint.Portal.SingleSignon.SSOCanaryChecker.b()
at Microsoft.SharePoint.Portal.SingleSignon.SSOCanaryChecker.b()
at
Microsoft.SharePoint.Portal.SingleSignon.Credentials.SetCredentials(UInt32
ui32Flags, String strApplicationName, Object[] Args)
at
MyApplication.Web.Clients.SharePoint.MyApplicationCredentials.butSave_Click (Object
sender, EventArgs e)
The line that throws the exception is:
Credentials.SetCredentials (1, "MyApplication", new string []
{tbUsername.Text, tbPassword.Text});
Everything else checks out - the username and password controls exist
and have values, the MyApplication app definition exists etc. There
really is no interesting code around the page.
The web form itself has a sharepoint:formdigest tag on it, by the way,
but that didn't change the behaviour - the error occurs either way.
I'm guessing that there's something I need to do to provide the proper
context for running the method, but I don't know what it is. Is it an
impersonation? Do I need to add a canary (whatever that means)?
Any thoughts or ideas?
Geoff