Handling authentication error in CRM Card DataFetch

Hello,

I’m developing a public App with a custom CRM card (attached to contacts) to display information from our platform (rest api). During the data fetch, we are using the signature validation + provided userEmail to identify the user on or platform and check if the user is known and has the right to see the information. In case of authentication or authorization problem, we return a http 401 or 403.

When this occured, a generic error message appears on the CRM card (along with an error entry in the App Monitoring)

Is there a way to handle thoses legitimate errors gracefully (displaying a “unauthorized” message to the user in card for example) without having to return a HTTP 200 ? ( like returning { “message” : “unauthorized” } in the body of the HTTP 401 response)

Thanks :slightly_smiling_face:

Hi, @PSeillé :waving_hand: Thanks for reaching out! Hey, @derekcavaliero @Gonzalo @KMurota do you have any experience here?

Thank you for taking a look! —Jaycee