Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
in Q2A Core by
edited by


  • Running a q2a forum siteQ.com
  • Running a custom website siteB.com with a custom script for user logins. 
  • I want to get rid of the custom login script. Instead I would like to use the table "qa_users" from siteQ.com (q2a forum) for the login handling.
  • I know already that I can access the q2a db and files from siteB.com via external integration


1. User does his login on siteB.com using table qa_users (works already with external integration)

2. User coming from siteB.com visits siteQ.com which recognizes the user as loggedin.

By the way, you know this login feature from Google and Stackexchange, for instance.


How can this be implemented?


I researched already and found on stackoverflow: 1, 2, 3. But probably there is a simpler way within question2answer.

Q2A version: 1.7.4
I thought I could just do from siteB.com: <form method="post" action="https://siteQ.com/login"> BUT the q2a forum expects the security token.
Are the 2 domains on the same server?
Yes, full root access and same database.
I think the way to achieve this is by using AJAX. I found an example here and will try to test it soon: https://github.com/0k/multidomain-sso

1 Answer

0 votes

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.


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, 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

...trying to clarify. Apologies if I came out harsh.

I know you've been trying to help the community. However, copying and pasting same content in most of the related questions (maybe) seems spam post. It sometimes irritates to see the same thing all around.




Thank you for pointing that out.
I agree with your point. I have removed my answer or edited wherever it's required.

That's the best I can do :)
Anyways, thank you for helping the community.