API Connect

 View Only
  • 1.  How do I map or edit error object after introspect

    Posted Tue November 01, 2022 11:21 AM
    This might be a basic question, but right now we are integrating a third-party OAuth provider. How can we edit the error response (Default APIC error response) after an introspect in case of an error? As far as I know, we cannot edit the response after an introspect in case of an error since the flow does not continue.

    ------------------------------
    Mohamed Alkhaligy
    ------------------------------


  • 2.  RE: How do I map or edit error object after introspect

    User Group Leader
    Posted Tue November 01, 2022 02:59 PM

    Hello Mohamed, 

    I have escalated your question to our team and should have an answer for you soon - I will either reply to you on here or email it to you. 

    Thank you for being part of the community



    ------------------------------
    Gabriel Marte Blanco
    Austin TX
    ------------------------------



  • 3.  RE: How do I map or edit error object after introspect

    IBM Champion
    Posted Tue November 01, 2022 07:03 PM
    Hi Mohamed,

    I would try first with a global policy customizing the preflow policies. (see https://www.ibm.com/docs/en/api-connect/10.0.1.x?topic=policies-customizing-preflow).
    If this is not working you can always proxy your introspect call via a proxy api (on your gateway) and customize the error response there.

    cheers,
    Jeroen Willems
    Integration Designers

    ------------------------------
    jeroen willems
    ------------------------------



  • 4.  RE: How do I map or edit error object after introspect

    Posted Sun November 13, 2022 04:23 AM
    Thank you Jeroen Willems for your suggestion.

    So far we have been successfully able to map most of the errors (by using full custom in the preflow policies) but is there a way to map errors like 404 Not found in case the API does not exist or 405 Method not Allowed?

    ------------------------------
    Mohamed Alkhaligy
    ------------------------------



  • 5.  RE: How do I map or edit error object after introspect

    Posted Tue November 15, 2022 11:40 AM

    Hi Mohamed,

    Have you tried a post-error global policy?  I' m not sure if the two errors you mention are "catchable' per https://www.ibm.com/docs/en/api-connect/10.0.1.x?topic=reference-error-cases-supported-by-assembly-catches, but it may be worth a try to see if a default catch there would work for these two and all of the others as well.  By catching them in the preflow global policy, what are you doing? Changing the error schema and then rethrowing the error? I'd think any pre-request error would simply flow to the error processing where the post-error global policy could just handle this mapping without having to rethrow errors to prevent the execution of the main assembly.
    Regards,

    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 6.  RE: How do I map or edit error object after introspect

    Posted Mon December 05, 2022 05:31 PM

    Hi Mohamed,

    I am in a same situations as you, do you mind sharing how you solved your issue with introspect and if you don't mind sharing a sample code of how you implemented. 

    Thanks 

    Chaise



    ------------------------------
    Chaise Matev
    ------------------------------