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
Veronica028
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
rubencm
Development Team Member
Development Team Member
Posts: 62
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
3Di
Registered User
Posts: 12983
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

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?
viewtopic.php?f=71&t=1771165
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: No registered users and 47 guests