improbable_airtime
Member
I've been working on a project the past few months where I've wanted to integrate XenForo with an external app, a Laravel app to be specific. I'm not trying to do anything too complicated, just basically have it so that if a user is logged into the forum, then they can access the app. If they aren't logged into the forum and they try and access the app, it just redirects them to the forum login.
I thought this would be fairly easy to achieve with XenForo since in my experience most modern forum softwares already have plenty of integration features like; Same Sign-On, Single Sign-On, REST API's with JWT functionality, etc... Yet I was mistaken. After months of playing around with different ideas and different integrations, I've almost come to the conclusion that there isn't really an ideal way to get this sort of functionality with XF, which is really quite disappointing. Every approach you take, there is always some ridiculous compromise you have to take, and most of the time you are left scratching your head at why/how something is happening due to lack of detailed documentation on pretty much anything relating to XenForo.
So I'm hoping to get a response from one of the developers as to why this is such a hard thing to achieve? XenForo is a great piece of forum software but trying to do any sort of integration with it has been one of the hardest things I've ever had to do as a developer, and it really feels lacking in that department.
In regards to integration, after scowering likely hundreds of forum posts about this topic, some dating back almost as long as 8 years ago, it seems like almost nothing has changed really, and that's quite disappointing. The most "reliable" method I've seen people using (and what I'm currently using) is manually importing the
I thought this would be fairly easy to achieve with XenForo since in my experience most modern forum softwares already have plenty of integration features like; Same Sign-On, Single Sign-On, REST API's with JWT functionality, etc... Yet I was mistaken. After months of playing around with different ideas and different integrations, I've almost come to the conclusion that there isn't really an ideal way to get this sort of functionality with XF, which is really quite disappointing. Every approach you take, there is always some ridiculous compromise you have to take, and most of the time you are left scratching your head at why/how something is happening due to lack of detailed documentation on pretty much anything relating to XenForo.
So I'm hoping to get a response from one of the developers as to why this is such a hard thing to achieve? XenForo is a great piece of forum software but trying to do any sort of integration with it has been one of the hardest things I've ever had to do as a developer, and it really feels lacking in that department.
In regards to integration, after scowering likely hundreds of forum posts about this topic, some dating back almost as long as 8 years ago, it seems like almost nothing has changed really, and that's quite disappointing. The most "reliable" method I've seen people using (and what I'm currently using) is manually importing the
XF.php
file into your external app and basically booting the entire forum framework a second time inside your app. This isn't ideal and it causes you to have to deal with a lot of compromises that make your app completely reliant on the XF internals, as well as not being very flexible in terms of development. For example, when using this approach you are accepting the compromises of;- Not being able to write any tests since XenForo's internal code breaks them in a number of places so you have to comment out a fair amount of stuff inside the actual XF code to get tests to run.
- Dealing with really weird session errors most of the time when authenticating.
- Having to deal with the overhead of basically booting/managing an entire forum framework inside your own project.
- Your Forum and App MUST be on the same filesystem.
- Having to do a fair amount of information duplication in databases, etc...
- Not being able to update XF ever basically unless you want to spend the time confirming every change and making sure none of your code broke.
- What is the correct/recommended way of handling functionality like this between XF and a third-party app? Obviously I do not expect a perfect answer since every situation/project is different. But at least having some form of documentation explaining the general idea of how you guys would recommend developers achieve this given how popular of a question it appears to be, I think would not only save the developers time, but also you guys time as well as it will result in less threads of "How do I implement XF auth into my 3rd party app" that you need to respond to constantly on an individual basis.
XF.php
method is really quite a terrible way to have to integrate XF into a third-party app.
Last edited: