I have created a webpage using the Ignition WebDev module and embedded it in a Perspective view using an iframe. I also implemented login and logout functionality.
In this popup, I enter User A’s credentials, while the Perspective session is already logged in as User B.
Problem:
When the WebDev page checks the user roles, it returns the roles for User A (entered in the popup login) instead of the roles for User B (the user authenticated in the Perspective session).
It appears that the browser-level authentication from the popup login is overriding or being used instead of the Perspective session's IDP authentication.
Question:
How can I ensure that the WebDev page uses the authenticated Perspective session user (User B) instead of the credentials entered in the popup login?
The issue is the use of an IFrame. IFrames are independent of, and carry no context from, the outer page. This is basic to IFrame security. (Except for keys embedded in their URL.)
I am using a custom login and logout page, and I manage the username, password, and roles in the database instead of using the Ignition User IDP. However, I am still getting this popup. Why is this happening?
WebDev doesn't hook into Perspective sessions automatically. Its sessions are independent.
Your WebDev content would need to delegate to the same IdP as Perspective using the SAML standard, with single-sign-on configured in that IdP.
I'm not sure what you mean by managing auth with your own pages, unless you've implemented a true external IdP? (Perspective has no way to script authentication outside of an assigned IdP.) You are unlike to share auth with Perspective without a shared IdP.
Yes. Implement SAML auth in WebDev. (You are on your own for this part--I've never done it because Perspective does it for me.) Point it at the same IdP.
You might be able to retrieve the PerspectiveSessionCollection from the WebDev's session prop, and then use .getOrCreateSession() to obtain the outer session.
(Use the perspective-session attribute on the WebDev session. This is what my blob server does.)