locked
Customer Portal LiveID login error - CRM 2011 online RRS feed

  • Question

  • Server Error in '/' Application.
    --------------------------------------------------------------------------------
    
    Object reference not set to an instance of an object. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
    
    Stack Trace: 
    
    
    [NullReferenceException: Object reference not set to an instance of an object.]
       Microsoft.Xrm.Portal.Web.Security.LiveId.WindowsLiveLogin..ctor(Boolean loadAppSettings) +30
       Microsoft.Xrm.Portal.Web.Handlers.LiveIdWebAuthenticationHandler..cctor() +72
    
    [TypeInitializationException: The type initializer for 'Microsoft.Xrm.Portal.Web.Handlers.LiveIdWebAuthenticationHandler' threw an exception.]
       Microsoft.Xrm.Portal.Web.Handlers.LiveIdWebAuthenticationHandler.ProcessLogin(HttpContext context) +45
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270
    
     
    
    
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 

    Hi, I origionally used Live ID auth and then changed to custom authentication. When I try to revert back to use LIve ID auth, I am getting the above error. Appreciate if someone could point me what am I missing here. Thank you 

    Friday, June 15, 2012 3:08 PM

All replies

  • Could it be that the Xrm.Portal.Web. ... dlls might have changed in the last couple of months and that might cause an issue? The visual studio didn't identify any such conflicts!!! Anyone 
    Friday, June 15, 2012 4:01 PM
  • Looks like I need to migrate to ACS Authentication. Is it mandatory? Any thoughts from anyone? 
    Friday, June 15, 2012 5:28 PM
  • Hi

    You need to use :

    DeviceIdManager from deviceidmanager.cs in SDK 2011

    you need the method :

    RegisterDevice() for create Live.Xml

    some like this:

    ClientCredentials

    // get devicecredentials

    deviceCredentials = DeviceIdManager.LoadDeviceCredentials(organizationUri);

    if (deviceCredentials == null)

    {

    deviceCredentials =

    DeviceIdManager.RegisterDevice(Guid.NewGuid(), organizationUri, Guid.NewGuid().ToString(), Guid.NewGuid().ToString());

    homeRealmUri =

    null;

    orgService =

    new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, deviceCredentials);

    orgService.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(

    new ProxyTypesBehavior());

    _service = (

    IOrganizationService)orgService;

    context =

    new Mycontext(_service);

    }

    else

    {

    homeRealmUri =

    null;

    orgService =

    new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, deviceCredentials);

    orgService.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(

    new ProxyTypesBehavior());

    _service = (

    IOrganizationService)orgService;

    context =

    new Mycontext(_service);

    }  Hope this help too : http://social.microsoft.com/Forums/en/crmdevelopment/thread/2d97836b-75eb-4f77-a568-c6a87e429ef7

    Monday, June 18, 2012 7:20 AM
  • Thanks Sonia for your response. Actually, the portals use the dll (microsoft.xrm.portal.web) that conflicted with version I had. Once I changed, it worked fine. 
    Wednesday, June 20, 2012 2:11 PM