Pass credentials between apps and IFrames

I have a web application (A) that contains an iframe . iframe includes another web application (B).

Suppose I log in to a web application. A and 5 different frames are displayed with 5 different modules. One of these modules is a CRM application that requires user login. How do I transfer the credentials of a registered user in web application A to this CRM module (web application B) hosted in an iframe ?

enter image description here

+4
source share
3 answers

The preferred way is to use JQuery .
There is a messaging concept in which I have used this in several projects. If you do not know about this, click this link.

If you travel on the Internet, you can find many posts related to it.

For your feasibility, I have posted a link below that will be useful to you:

jquery-postmessage-plugin

jquery-ba-postmessage-js

postmessage.freebaseapps.com

Example:

 pm({ target: window.frames["example2"], type:"message2", data:{hello:"world"}, success: function(data) { $("#example2").after(JSON.stringify(data)); } }); pm.bind("message2", function(data) { $(document.body).append(JSON.stringify(data)); return {foo:"bar"}; }); 

Let me know if this does not help you.

+3
source

I assume you are using Form Authentication, this article describes how you can share credentials on multiple sites

+1
source

Assuming we are talking about Dynamics CRM, you can get information about the user through a simple WhoAmIRequest , which will retrieve the current user information (based on the systemuser object). You are still logged into CRM, so it shouldn’t be very different from what you have already done (or I assume you did)

I think there is an example in the SDK that does just that, you can watch it.

-1
source

Source: https://habr.com/ru/post/1381513/


All Articles