Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Events Portal with Azure B2C - Issue with custom Event API

(0) ShareShare
ReportReport
Posted on by 80

My Events Portal is integrated with Azure B2C, the user sign-in works correctly.

There is a requirement where my Home page should filter the listed Events by a custom field. Note: the Home Page Events should also be visible to Anonymous Users.

As it is not possible to manipulate the out of the box Event API that queries the published events, I decided to create a custom API structure, adding on my web template a FetchXML that filters the Published Events by the custom field.

On my Angular project, I made the necessary changes to call my Custom API to load the data for the Home Page, instead of the OOB Events API.

So basically, when loading the Home page, instead of calling:

https://myorganization.svc.dynamics.com/EvtMgmt/api/v2.0/events/published/ (OOB)

My Portal calls the custom API:

https://myorganization.svc.dynamics.com/EvtMgmt/api/v2.0/events/openevents/ (CUSTOM)

Before I set up the integration with Azure B2C, this approach was working fine, only the filtered events were being displayed on my Home Page. But since I set up the integration with Azure B2C, the Events Portal is not being able to reach my Custom Event API.

On the Angular project, I configured the environment.ts file according to Microsoft's documentation, defining the emApplicationToken value (that I took from the created Web Application record) and the  aadB2CConfig.

Notice the issue happens no matter if I am signed in on the Portal or not.

1423.Error.PNG

Below we can see the Request Header for reference.

pastedimage1632927155501v5.png

I also tried to undo the change on the function that calls the API, making it call the original OOB Event API. Once I did this, the Home Page loaded successfully the list of Events (without the required filter). That means the issue happens specifically when calling the Custom Event API.

pastedimage1632925646984v3.png

Note: I running the Portal locally.

Any hints on why the Portal can't reach the Custom Event API when B2C is enabled??

  • Suggested answer
    Tiago Freitas Profile Picture
    Tiago Freitas 80 on at
    RE: Events Portal with Azure B2C - Issue with custom Event API

    Hi Diana,

    I assume you’re aware the Events Portal has two types of OOB APIs.

    One is going to be deprecated at some point, and the second is the 2.0 version, which I added the URL in my post:

    […]api/v2.0/events[…]

    In the end I found it was not possible to use the API 2.0 the way I intended, customizing the fetchXML with my filter.

    My custom query would only work with the API endpoint that will be deprecated at some point.

    As a workaround and temporary solution the portal front end was changed to call my custom API only on specific pages, were needed. All the remaining pages would continue working OOB, including the part which integrates with Azure B2C.

    Best regards,

    Tiago

  • Diana Roy Profile Picture
    Diana Roy on at
    RE: Events Portal with Azure B2C - Issue with custom Event API

    Hello Thiago, just checking how/if the above issue got resolved? thank you, Diana

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans