web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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??

I have the same question (0)
  • Diana Roy Profile Picture
    on at

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

  • Suggested answer
    Tiago Freitas Profile Picture
    80 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 60 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans