How can I embed login credentials in a iframe src?

6.5k Views Asked by At

How can i pass user auto login in src url?

   <iframe src="https://secure.aws.XXX.com/app/share/28228b0ccf0a987" width="1060px" height="1100px"></iframe>

I tried this but display the login screen

   <iframe src="https://secure.aws.XXX.com/app/share/28228b0ccf0a987?username=username&password=password" width="1060px" height="1100px"></iframe>
1

There are 1 best solutions below

0
On

If you are trying to have the page login to something at the same time they are viewing it, you might not be able to do this as your request may need to be a POST method, in which case, your iframe will only perform a GET request. You may need to use something like AJAX to do what you need.

Also, as per Havenard's comment, it depends on the authentication method that may be needed by the authenticating server. This would require a better understanding of the service you are connecting to as it may not allow for authentication the way you are trying to use.