-3

How to make a script or something to automatically log me in once I enter an iframe of an external website?

For example:

<li> <a href="http://erwin.audi.de"  data-fullscreen="true" data-title="Audi" width="1000" height="900">Audi</a></li>

Once the user clicks on the audi menu item. It opens up audi website and gets the credentials (username/password) from my database and automatically log the user into the audi website.

Is it possible? I don't know if i can do this with only javascript or only php.

Kinder
  • 7
  • 1
  • 9
  • Basicly, people log into our platform, there they put their certificates related to their cars and all. if they need to send in a part of a car, they click on the menu of the car brand and it opens up a frame. To save trouble for the users, we want the page to log them in automatically. Plus, we have their credentials of the car brand website in our database aswell – Kinder Jun 08 '16 at 11:45
  • You're sharing credentials? Are you sharing hashing methods too? Yikes! – Jay Blanchard Jun 08 '16 at 12:03
  • What you mean by sharing credentials? – Kinder Jun 08 '16 at 15:04

1 Answers1

1

You can't login users from your application onto external websites until and unless they don't provide you an interface which allows you to do so. This is generally achieved by way of APIs.

However, there is one way of achieving it still. Since you suggest you have raw user credentials for the external websites, you could send a POST request to their login page. If you try this approach, make sure you are doing it on the client side (via JS and AJAX) since you want to log in the user system and not the server.

This approach is a bit complex and not advisable, but it would get the job done. Search for APIs first, but will most probably fail to find them.

Hope this helps.

Swakeert Jain
  • 776
  • 5
  • 16
  • Well my platform is a closed acess one. It's not public, nor you can create account for yourself. Do you have any suggestions on keywords to find it? – Kinder Jun 08 '16 at 14:51
  • Is it something like this??? [jQuery AJAX cross domain](http://stackoverflow.com/questions/3506208/jquery-ajax-cross-domain) – Kinder Jun 08 '16 at 15:31
  • keywords to find where? on google/ stackoverflow for answers? – Swakeert Jain Jun 08 '16 at 19:14
  • Google or stackoverflo, i've been looking but i've never done an API so i'm not sure if i already found the answer – Kinder Jun 09 '16 at 15:15