Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How to create several q2a websites with single sign on?

+2 votes
449 views
asked Dec 7, 2014 in Q2A Core by Vadym
retagged Dec 7, 2014 by Vadym
Hi guys, I need your help

I have a q2a website. I'd like to create one more with single-sign-on.  So that users don't have to register two times.

I've tried to do as it was written here:http://www.question2answer.org/single-sign-on.php

But seems that it's not what i'm looking for...

In other words how to have single qa_users for  several websites
Q2A version: 1.7b

2 Answers

+2 votes
answered Dec 7, 2014 by maxjtechno
selected Dec 7, 2014 by Vadym
commented Dec 7, 2014 by Vadym
It works, thanks very much.  but one more question
It shows this error if i ask a question:
"
A Question2Answer database query failed when generating this page.
A full description of the failure is available in the web server's error log file.
"

There's not any description in error log though, I can't find any solution for this
+2 votes
answered Dec 27, 2017 by mshah
edited Dec 28, 2017 by mshah

If you do not want to share your DB with the WordPress installation, you can use one more WordPress installation as a single sign-on server.

E.g.

For us,

We have

https://publicityport.com (WordPress)

https://softwaretestingboard.com (WordPress MultiSite)

https://softwaretestingboard.com/qna (Question2Answer)

https://digitalmarketing.q2a.io (Question2Answer)

All four site can connect to one common server (SSO), https://myaccount.publicityport.com to get the user authorized.

So, users do not really have to create a separate account for all sites. 

For, WordPress you can create a single sign-on client. And for Q2A, you can use the plugin, https://github.com/PublicityPort/q2a-publicityport-login

commented Dec 28, 2017 by ProThoughts
@ mayur, where do you store users? wordpress db or q2a db or publicityport.com db ?
commented Dec 28, 2017 by mshah
it will be stored at both places. publicityport.com will be acting as an identity provider. It will store username, password and other user information. So, any site that wants this information and that is registered with publicityport.com can obtain it with user's permission and store user information in it's on DB as well.
commented Dec 28, 2017 by ProThoughts
so it mean it stores users info in wp, q2a and publicityport database. When user access wordpress then it access from wp db and when user access q2a it uses q2a db right?

publicityport helps to copy users into two db right?
commented Dec 28, 2017 by mshah
PublicityPort.com is SSO server. So, every time the user wants to log in, the user will be redirected to the publicityport server, the user enters publicityport credentials and it will be redirected back to the site he came from.
commented Dec 28, 2017 by mshah
The user can have any kind of SSO client, WordPress, q2a, Joomla, or any other SSO client, can use https://myaccount.publicityport.com as an SSO server.
commented Dec 28, 2017 by ProThoughts
If site owner selects publicityport.com as SSO server and after 2 year decide to cancel account, then how they can transfer all user accounts?
commented Dec 28, 2017 by mshah
That's a very valid point. It's pretty simple.

The site owner will have all users information stored in his own site database. The site owner can disable SSO client on the site, and ask users to reset the password to login to the site.  So, the user can directly login to the site with the new password, w/o being redirected to publicityport.com.
commented Dec 28, 2017 by ProThoughts
edited Dec 28, 2017 by ProThoughts
Not a good idea to request users to reset password.

I feel you should update user info/password etc in both places when there are any changes. If site owner decides to discontinue publicityport service then they will not face any issues.
commented Dec 28, 2017 by mshah
Well, that's not how SSO works. SSO server never update any database. SSO server just authorize the user and supply it's identity to the asking party, i.e. your site.
commented Dec 28, 2017 by mshah
You can read this article to know more about SSO server http://searchsecurity.techtarget.com/definition/single-sign-on
commented Dec 28, 2017 by ProThoughts
I know about that. you need to think about if some site owner discontinues service then how to transfer user credentials, without asking all users to reset password.

Also any user authentication delay from your site will cause issue for q2a site. I hope it is running on good server.
commented Dec 29, 2017 by mshah
Thank you for your input. We will certainly look into the possibilities.

I understand your concern about the delays, our sites are running through cloud flare infrastructure. We have not received any single complaint about downtime.
...