Azure / api-management-developer-portal

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

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

Open girish-tank-avnet opened 6 months ago

girish-tank-avnet commented 6 months 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 5 months ago

Is this self hosted or managed portal?

sthirthala commented 5 months ago

Did you turn on CORS setting in developer portal

girish-tank-avnet commented 5 months ago

yes. i have enabled it.

image

ygrik commented 1 month ago

As I understand this issue is not related to CORS. It's related to send a navigation request to parent window (to keep current user session).