RE: Single Sign-On User Credentials Question



Ahh...so you caught the original exception and then re-threw one in the catch
block. My considered opinion (ie a guess pulled out of the air) is that your
error message means that GetCredentialEntryURL can't find an Enterprise
Application with your Enterprise Application name. The example uses two
different EA names in its calls to GetCredentials and GetCredentialEntryURL.
I don't know why -- I just use one. And it can't be the Display Name, it has
to be the Application Name you entered on the Edit Enterprise Application
Definition screen of SharePoint Central Administration. I also have lingering
doubts as to the possibility of the case-sensitivity of the Application Name,
so that might be worth a check.

I apologize if my advice is obvious, but I got burned along these same lines
earlier.

Regards,
chris

"Trevor Conn" wrote:

Chris -- Thanks for the response. I've gotten a little bit further -- at
least I know where the error is coming from and what the real problem is.

Referring back to the code sample from the technet article, you can see that
in the catch block for the SingleSignonException there's a call to:
SingleSignonLocator.GetCredentialEntryURL(appName)

This is where the problem actually is. This call is failing and throwing the
following error:

System.NullReferenceException: Object reference not set to an instance of an
object.
at
Microsoft.SharePoint.Portal.WebControls.SiteInfo.GetSiteInfoCacheKey(PortalContext ctx)
at Microsoft.SharePoint.Portal.WebControls.SiteInfo.a(PortalContext A_0)
at Microsoft.SharePoint.Portal.WebControls.SiteInfo.a(PortalContext A_0,
Boolean A_1)
at Microsoft.SharePoint.Portal.WebControls.SiteInfo.GetSiteInfo()
at Microsoft.SharePoint.Portal.SingleSignonLocator.a(UInt16 A_0)
at
Microsoft.SharePoint.Portal.SingleSignonLocator.GetCredentialEntryUrl(String
strApplication, UInt16 sslPort)
at
Microsoft.SharePoint.Portal.SingleSignonLocator.GetCredentialEntryUrl(String
strApplication)
at WebPartLibrary.InfoPanel.CheckCredentialsDEBUG() in
c:\projects\webpartlibrary\infopanel\infopanel.cs:line 97

This seems to indicate that it can't find the login URL for my application.
I don't believe this is something I have to set up. From everything I've read
the login form is generated by SharePoint itself. So anyway, this is where
I'm stuck now.

Thanks for any help,
Trevor

"cwogle" wrote:

Trevor,

I created a single signon web part starting from the same code sample you
did. Mine sends the user to the correct login page when they click the "Click
here..." link. My thoughts...

1. The sample uses "SampleApp" in the call to GetCredentials, but uses
"MyIndividualApplicationID" in the call to GetCredentialEntryUrl. I don't
know why. My code uses the Enterprise Application name (or is that ID?) in
both places.

2. I had problems getting the sample code to work when it was inside
RenderWebpart() (as the example is). I moved the code to the OnLoad() event
of a dropdown list in the web part (in my case, the dropdown list is
populated with data from an external database that requires a separate login,
hence the single signon). I don't know why this made a difference. By moving
the code out of RenderWebpart(), I could no longer use "writer" and had to
add an error message string to the web part which gets enabled if an error is
detected.

3. I get the same error message when an unhandled exception occurrs. It
sounds like your code should catch any problem in GetCredentials. Is it
possible you are catching the exception but somehow rethrowing it inside the
catch block? Can you step through the code to find out exactly who is
throwing the exception?

Regards,
Chris
.



Relevant Pages

  • RE: Biztalk 2006 Tutorial 3
    ... There are some known issues w/ the tutorials. ... Below is the error message that appears in the event ... Exception type: ServiceCreationException ... md, Objectargs, Object server, Int32 methodPtr, Boolean fExecuteInContext, ...
    (microsoft.public.biztalk.general)
  • RE: Concerns about exception string revealing internals/data about
    ... exceptions could return certain information as part of the error message. ... exception occurs in my program, is it possible that the exception error ... built in ADO objects in Visual Studio for Microsoft SQL Server. ... the build-in controls in SQL Server2000 or .Net winform/Asp.net controls? ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Concerns about exception string revealing internals/data about
    ... Sorry in last post I meant an "unhandled" exception should never be shown to ... exceptions could return certain information as part of the error message. ... built in ADO objects in Visual Studio for Microsoft SQL Server. ... the build-in controls in SQL Server2000 or .Net winform/Asp.net controls? ...
    (microsoft.public.dotnet.framework.clr)
  • RE: Biztalk 2006 Tutorial 3
    ... Below is the error message that appears in the event ... Exception type: ServiceCreationException ... Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._createOrRehydrateRealService(Guid& instanceId, IBTMessage currMsg) ... md, Objectargs, Object server, Int32 methodPtr, Boolean fExecuteInContext, ...
    (microsoft.public.biztalk.general)