none
Microsoft.IdentityModel Erorr once the WCF service is down

    Question

  • Dear All,

     

    I have an FBA enabled Share Point 2010 site. I am having a strange issue. On my login page, I am calling a WCF service which checks whether the user trying to login is blacklisted or not. If he is not blacklisted he is allowed to enter otherwise a message appears to him. The WCF service is coming from another integration server. I have noticed this , if the integration server is not available (http: 404, or http: 503) due to some reason. I get the following error on my login page and user are unable to login to the site, and the whole system is disturbed. Once the integration WCF server is up again, MY login page also appears and works fine.  

     

    [NullReferenceException: Object reference not set to an instance of an object.]
    Microsoft.IdentityModel.Configuration.ServiceConfiguration.GetCurrent() +90
    Microsoft.IdentityModel.Claims.ClaimsPrincipal.CreateFromHttpContext(HttpContext httpContext, Boolean clientCertificateAuthenticationEnabled) +29
    Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnPostAuthenticateRequest(Object sender, EventArgs e) +58
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +79
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +170

     

    I know that the service coming from integartion server is also a WCF serice while the security token service used for FBA is also a WCF service but whats the relation between them and why my login page shows this error?

     

    Please help me out if you know the reason behind that?

     

    Thanks in Advance....

     

    Sami

     

     

     

     




    Monday, July 04, 2011 12:37 PM

Answers

  • Dear Manas,

     

    Thanks for your reply. After striking my head with the wall for a few days , I have successfully resloved the issue. There was a problem in the way I was dealing with the WCF service on my login page.

     

    After the try catch block in the finaly sectioin I should have disposed my proxy object, and the operation scope object. i.e.

     

    finaly

    {

    operationscope.dispose();

    proxyclient.close();

    }

     

     I hope that it may help someone.

     

     

     

     

     

    • Marked as answer by Sami Khan Sunday, August 21, 2011 11:07 AM
    Sunday, August 21, 2011 11:07 AM

All replies

  • Hello Sami,
     
    Thank you for your post. I don’t know how your WCF service is related to Security Token Service WCF service but the following blog  talks about how Security Token Service WCF service works with FBA.
     
    http://blogs.msdn.com/b/russmax/archive/2010/05/27/understanding-sharepoint-2010-claims-authentication.aspx
     
     
    In brief STS validates the token "Claims Based Identity" and generate a new security "SAML" token back to the client. This token is generated by SharePoint and for SharePoint. The client sends this SAML token to SharePoint to prove that he/she is officially authenticated. SharePoint validates and authenticates user and an SPUser object is created and is used for authorization.

    As for your error is concerned it looks like it is trying to create IClaimsPrincipal object and then it throws nullreference exception. Please check if you are getting Security Token in your code before it passes to Security Token Service WCF service.

    Thanks

    Manas

    Wednesday, August 17, 2011 2:50 AM
  • Dear Manas,

     

    Thanks for your reply. After striking my head with the wall for a few days , I have successfully resloved the issue. There was a problem in the way I was dealing with the WCF service on my login page.

     

    After the try catch block in the finaly sectioin I should have disposed my proxy object, and the operation scope object. i.e.

     

    finaly

    {

    operationscope.dispose();

    proxyclient.close();

    }

     

     I hope that it may help someone.

     

     

     

     

     

    • Marked as answer by Sami Khan Sunday, August 21, 2011 11:07 AM
    Sunday, August 21, 2011 11:07 AM