You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All code examples are suggesting to implement the silent renew page with the following:
window.onload = function () {
const event = new CustomEvent('oidc-silent-renew-message', { detail: window.location });
window.parent.dispatchEvent(event);
};
(https://angular-auth-oidc-client.com/docs/documentation/silent-renew)
We are serving the silent redirect page from our CDN, so, from another (controlled) domain.
Calling window.parent.dispatchEvent(event) is prevented by CORS. If we want to be able to work cross domain then the postMessage API should be used.
I didn't found an existing possible solution to this so I'll try the following:
In the main page I'll create a "bridge" to capture the message and transform it into a CustomEvent
// In the parent window
window.addEventListener('message', (event) => {
// checks to ensure the message is from a trusted source
if (event.origin !== 'https://t-www.acerta-cdn.be') return;
if (message.key === 'silent-renew') {
// Create the custom event with the attributes from the message
const customEvent = new CustomEvent('oidc-silent-renew-message', {
detail: event.data
});
// Dispatch the custom event
window.dispatchEvent(customEvent);
}
});
Would you see a better way?
The text was updated successfully, but these errors were encountered:
All code examples are suggesting to implement the silent renew page with the following:
(https://angular-auth-oidc-client.com/docs/documentation/silent-renew)
We are serving the silent redirect page from our CDN, so, from another (controlled) domain.
Calling
window.parent.dispatchEvent(event)
is prevented by CORS. If we want to be able to work cross domain then thepostMessage
API should be used.I didn't found an existing possible solution to this so I'll try the following:
In the main page I'll create a "bridge" to capture the message and transform it into a
CustomEvent
Would you see a better way?
The text was updated successfully, but these errors were encountered: