Authenticate user against PhPbb database

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Registered User
Posts: 1
Joined: Sat Oct 13, 2018 7:00 am

Authenticate user against PhPbb database

Post by Veronica028 » Mon Oct 15, 2018 5:12 am

Recently I have started implementing a solution which will use a PhPbb database for forms authorization, I have used the class from this below thread:

PhPbb C# Authentication Port

So i wrote a membership provider using this class in the 'ValidateUser' function:

Code: Select all

public override bool ValidateUser(string username, string password)
        ForumsDataContext db = Root.ForumsDataContext;
        PhPbbCryptoServiceProvider phpbbCrypt = new PhPbbCryptoServiceProvider();
        string remoteHash = db.Users.Where(u => u.UserName == username).FirstOrDefault().UserPassword;
        if (String.IsNullOrEmpty(remoteHash))
            return false;
        return phpbbCrypt.phpbbCheckHash(password, remoteHash);
However this always returns false as the 'phpbbCrypt.phpbbCheckHash' returns false and I do not know enough about PhPbb to determine why the hashes are not matching up.

Any sugestions?

User avatar
Development Team Member
Development Team Member
Posts: 77
Joined: Fri Oct 05, 2007 2:24 pm
Location: Spain

Re: Authenticate user against PhPbb database

Post by rubencm » Mon Oct 15, 2018 5:22 am

What is PhPbbCryptoServiceProvider?, phpBB supports multiple hashing algorithms

I think is better to do the check with phpbb components and with and api or something expose if username & password is correct

User avatar
Former Team Member
Posts: 13474
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco

Re: Authenticate user against PhPbb database

Post by 3Di » Mon Oct 15, 2018 12:13 pm

rubencm wrote:
Mon Oct 15, 2018 5:22 am
What is PhPbbCryptoServiceProvider?
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Post Reply

Return to “[3.2.x] Support Forum”