locked
CRM 2011 - OnPremise - ADFS: Catch exception when authenticate user who is in AD but not in CRM database RRS feed

  • General discussion

  • Hello everyone,

    I need your help how to checking user authentication and authorization in CRM 2011. This is my current situation.

    +I have an "external web service" which is required user login using their credential from AD. Then user can call some request and the web service will execute the request against CRM server with their credential --> It works fine.

    +The "external web service" is doing his job fine by authenticate user using their AD credential. If user enter incorrect information --> reject.

    *The problem is: if an user is available in AD but not in CRM database --> The CRM service will return a FaultException with general message:

    Unhandled Exception: System.ServiceModel.FaultException: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.

    In CRM trace log, we can easily find the root error:

    Exception details: Microsoft.Crm.CrmConfigObjectNotFoundException: User Was Not Found

    **The point here is CRM server doesn't throw Microsoft.Crm.CrmConfigObjectNotFoundException to my web service --> I can't catch it to check if user is available in CRM database or not. It only throw an general exception System.ServiceModel.FaultException --> and I don't want it.

    Do you know how catch Microsoft.Crm.CrmConfigObjectNotFoundException exception when authenticate user?

    Many thanks.

     

    Monday, May 19, 2014 3:30 AM

All replies

  • Have you tried turning on IncludeExceptionDetailInFaults as suggested in the generic error ?

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Monday, May 19, 2014 1:33 PM
    Moderator