0

I have two sites and want to be logged in on both of them when I log on one of them. What's the easiest way of doing it? I can't use any of the facebook auths etc.

zarcel
  • 1,211
  • 2
  • 16
  • 35
  • How do you log in? Where are stored/checked the credentials? – Eggplant May 05 '15 at 10:39
  • On the first site I have php app with database(credentials are there) and on the other site I have no but it may be php/java – zarcel May 05 '15 at 10:42
  • I can't think of a practical reason you would like that (in the sense of an user's awareness), but if you have a database that both sites will share, then you could manage the logged in status in there. A different problem then would be how to manage a cookie with at least the user name. Try this question: http://stackoverflow.com/questions/3342140/cross-domain-cookies – Eggplant May 05 '15 at 10:54
  • We have separate databases. We just want to integrate 2 platforms from different companies with as least editing of the code as possible(on one side) – zarcel May 05 '15 at 10:56

2 Answers2

1

What I think you are asking for is called Single Sign On and there are many available libraries to help you get started with them. You can check a lot of questions here on Stackoverflow for Single Sign On(SSO).

See this PHP library for a start https://gitorious.org/lightopenid

OmniPotens
  • 1,125
  • 13
  • 30
0

The least coding is going to be required if you try to do a browse based login into both sites. This can be easily accomplished using something called browser extensions (thats what this is called in chrome, safari and firefox). On IE, its called IE - addon.

Anyway, there are three possibilities. 1. If its ok with you to develop this on your own and maintain it and ask users to use only one browser then i would go with this - Create your own browser extension (This is of intermediate difficulty...so you can read up on this and do it yourself. https://developer.chrome.com/extensions/getstarted )

  1. If you dont want to restrict your users with only one browser and let them use any browser, then it will be a little more difficult because you need to create an extension each for three browsers and an IE addon.

  2. You can simply use a 3rd party browser extension and get going very quickly. There will be a little bit of prep work but you can get going in a day. E.g. you can use this - but only after creating an account with them. http://miniorange.com/tips/single-sign-on/how-to-enable-the-miniorange-single-sign-on-browser-extension/

  • Restricting browsers and installing exstensions is not an option. This needs to be transparent to end users. – zarcel May 07 '15 at 12:30