Is it possible to authenticate from outside?

Yaro

New member
There is REST API to create new / update existing user in Xenforo from your application. But is it possible to authenticate user on Xenforo using your application?.. I.e. - raw clean ("New Private Window") user authenticates on my site.com and I am also (somehow) authenticate him on Xenforo as well. Is it easy? Do I need to have both my app (where login happens) and Xenforo to live on same domain? Thanks!
 

dknife

Active member
There's an auth endpoint on the API that allows you to test a username/password combination but if you want to integrate the actual user information into a site outside of XenForo you really have to be on the same server and bring in XenForo's structure into your site. I've been using XF for user auth and profile for years now on my site outside of the forums and doing it for XF2 now as well on dev.

As for the domain it will likely require the same as it will be pulling cookie/session information from whatever is configured for XenForo. I don't know enough about how XF works with cookies and CORS to really comment.
 

Yaro

New member
I have my own users' DB and want to keep it like this, what I want is for my users to be able to use forums to talk. For this purpose I need (1) to be able to push/update User entity from my site to XF2 (that is doable via REST) and (2) to authenticate users on XF whenever they authenticate on my site.

I want to turn off any user management routines like passwords changes, email changes, etc on XF. This will be done only on my site. What you are suggesting is something opposite - i.e. use XF's user management routines for my main site which I don't want.

Thanks!
 

dknife

Active member
I believe XenForo has an external auth framework which is used for Google/Twitter/Facebook login and there are some addons which hook into other resources as well, like OAuth which you could implement on your site. So... possibly? I only have experience in hooking into XFs auth, not the other way around sorry.
 
Top