Azure / api-management-developer-portal

Developer portal provided by the Azure API Management service.
MIT License
478 stars 306 forks source link

Custom Gadget- User session is not detected while navigating to other page from Cutom Gadget #2480

Open girish-tank-avnet opened 1 month ago

girish-tank-avnet commented 1 month ago

Hello,

In the Developer Portal, I created a custom widget for product subscription. This widget allows users to subscribe to a product while collecting additional information for the subscription.

image

After making a call to the Management API to subscribe to the product, and upon a successful event ("onsuccess") from that Management API call, I navigate the user to the "Profile" page. Since the custom widget is loading in an iframe within the Developer Portal, I have to navigate to the Profile page using the following syntax:

window.parent.parent.location.href = DEVELOPER_PORTAL_URL + "/profile"

This successfully navigates the user to the Profile page; however, the current user session is not recognized by the Developer Portal. Ideally, the user should see "Profile" and "Sign Out" menu items at the top right corner, as the user is already logged in. Instead, only the "Sign In" and "Sign Up" menu items are visible.

image

If the user refreshes the page, the current user session is then detected, and the menu text correctly shows "Profile" and "Sign Out" as expected.

sthirthala commented 1 month ago

Is this self hosted or managed portal?

sthirthala commented 2 weeks ago

Did you turn on CORS setting in developer portal

girish-tank-avnet commented 2 weeks ago

yes. i have enabled it.

image