如何实现auth跨站点?

时间:2022-05-20 16:54:43

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.

我有两个站点,并且当我登录其中一个站点时想要登录它们。这是最简单的方法吗?我不能使用任何facebook auths等。

2 个解决方案

#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 * for Single Sign On(SSO).

我认为你要求的是单点登录,有许多可用的库可以帮助你开始使用它们。您可以在*上查看有关单点登录(SSO)的大量问题。

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

请参阅此PHP库以获取开始https://gitorious.org/lightopenid

#2


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.

如果您尝试对两个站点执行基于浏览的登录,则需要最少的编码。这可以通过使用称为浏览器扩展的东西轻松完成(这就是在chrome,safari和firefox中调用的内容)。在IE上,它称为IE - 插件。

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.如果您可以自己开发并维护它并要求用户只使用一个浏览器,那么我会使用它 - 创建您自己的浏览器扩展(这是中等难度...所以你可以读取在此并自己动手.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.

    如果您不想仅使用一个浏览器来限制用户并让他们使用任何浏览器,那么它将会更加困难,因为您需要为三个浏览器和一个IE插件创建一个扩展。

  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/

    您只需使用第三方浏览器扩展程序即可快速上手。会有一些准备工作,但你可以在一天内开始。例如。你可以使用它 - 但只能在用它们创建一个帐户之后。 http://miniorange.com/tips/single-sign-on/how-to-enable-the-miniorange-single-sign-on-browser-extension/

#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 * for Single Sign On(SSO).

我认为你要求的是单点登录,有许多可用的库可以帮助你开始使用它们。您可以在*上查看有关单点登录(SSO)的大量问题。

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

请参阅此PHP库以获取开始https://gitorious.org/lightopenid

#2


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.

如果您尝试对两个站点执行基于浏览的登录,则需要最少的编码。这可以通过使用称为浏览器扩展的东西轻松完成(这就是在chrome,safari和firefox中调用的内容)。在IE上,它称为IE - 插件。

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.如果您可以自己开发并维护它并要求用户只使用一个浏览器,那么我会使用它 - 创建您自己的浏览器扩展(这是中等难度...所以你可以读取在此并自己动手.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.

    如果您不想仅使用一个浏览器来限制用户并让他们使用任何浏览器,那么它将会更加困难,因为您需要为三个浏览器和一个IE插件创建一个扩展。

  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/

    您只需使用第三方浏览器扩展程序即可快速上手。会有一些准备工作,但你可以在一天内开始。例如。你可以使用它 - 但只能在用它们创建一个帐户之后。 http://miniorange.com/tips/single-sign-on/how-to-enable-the-miniorange-single-sign-on-browser-extension/