Hi,
The following code is used in a custom WebPart, and for some reason it only works the first time it's executed on a page. After that it throws a SingleSignonCredsNotFoundException
Any help or suggestions to how to solve this problem is much appreciated.
public static SsoIdentity GetCredentials(string applicationName)
{
try
{
ISsoProvider ssoProvider = SsoProviderFactory.GetSsoProvider();
SsoCredentials credentials = ssoProvider.GetCredentials(applicationName);
string[] tmp = ConvertSecurityStringToString(credentials.UserName).Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
string username = tmp[1];
string domain = tmp[0];
string password = ConvertSecurityStringToString(credentials.Password);
SsoIdentity wi = new SsoIdentity(username, password, domain);
return wi;
}
catch (SingleSignonCredsNotFoundException ex)
{
}
catch (SingleSignonException ex)
{
}
return null;
}