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.
Below we can see the Request Header for reference.
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.
Note: I running the Portal locally.
Any hints on why the Portal can't reach the Custom Event API when B2C is enabled??
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
Hello Thiago, just checking how/if the above issue got resolved? thank you, Diana
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156