XF 2.2 Laravel using Xenforo login

Jerimu

Member
Hi Xenforo People,

I was searching for a way to login on a laravel app with my xenforo user.
To achieve this i tried this. https://stackoverflow.com/questions...om-xenforo-database-with-using-several-tables
But didn't get it to work but really want to integrate it so people dont have to use multiple logins.

So some information about the laravel app. I wanted to try it first so its a clean Laravel 8 project wit Laravel jetstream Livewire.
If someone can help me out would be really nice. (And the topics i found about where to old sad enough.)

Greetings,
Jerimu
 
You can either launch the XenForo app in your laravel project to let XF handle your sessions for you, use the API to send Serverside calls to XF to verify a users credentials and subsequently load their user object or query from the auth table making sure to implement all relevant password algorithms in your laravel project.
 
You can either launch the XenForo app in your laravel project to let XF handle your sessions for you, use the API to send Serverside calls to XF to verify a users credentials and subsequently load their user object or query from the auth table making sure to implement all relevant password algorithms in your laravel project.
And wich is the relevant password algorithm? That’s where i stranded last time.
 
xf_user_authenticate lists the relevant algorithm for each user in the scheme_class column. The classes are stored in src/XF/Authentication, and future updates could add new ones, as well as 3rd party add-ons providing new schemes that are stored in each individual add-ons directory.
 
I'm currently making a new Laravel backend and I used my previous XF integration on my site to create new libraries in Laravel to act as XF integrations, including verifying user access and obtaining user information. It's not the same as integrating into the user auth and user model in Laravel, which is maybe what you want. With a general XF class I'm able to hook into any XF functions, including anything provided by addons which is important.
 
Since XF 2.2, in REST API added a method auth/from-session. You can use them for retrieving information about user by cookie xf_session or remember key.
 
I've managed to get the login working. So only the session is needed now.
Since XF 2.2, in REST API added a method auth/from-session. You can use them for retrieving information about user by cookie xf_session or remember key.
This will help with that i think.
 
I know is old post but because i searched too much for a way to check if user is authorized or not, using xenforo api with laravel 8 App i would like to share my code maybe will be useful for you @Jerimu or anyone in future:

PHP:
$session_id  = $_COOKIE['xf_session'];
$response = Http::withHeaders([
    'XF-Api-Key' => 'YOUR-XF-API-KEY'
])->post('http://www.yourdomain.com/xenforo/api/auth/from-session/?session_id='.$session_id);

$xfUaer = $response->json();
dd($xfUaer);
 
Hi Xenforo People,

I was searching for a way to login on a laravel app with my xenforo user.
To achieve this i tried this. https://stackoverflow.com/questions...om-xenforo-database-with-using-several-tables
But didn't get it to work but really want to integrate it so people dont have to use multiple logins.

So some information about the laravel app. I wanted to try it first so its a clean Laravel 8 project wit Laravel jetstream Livewire.
If someone can help me out would be really nice. (And the topics i found about where to old sad enough.)

Greetings,
Jerimu
Is there is any update? I am looking for the same solution
 
Top Bottom