News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Using User Account Data in SMF on external system

Started by BossOfGames, March 26, 2015, 03:23:06 PM

Previous topic - Next topic

BossOfGames

Hey all,

I am developing an external tournament system. The one thing I do not want my users to have to worry about is creating another account to use the system. Instead, I want to call my SMF database containing the account data. I am also using a custom login screen for this website since it will be viewed normally on mobile devices and game consoles. So how do I authenticate users of my system using the SMF database instead of creating my own scheme?

Thanks!

Kindred

load SSI.php and then use the standard SMF functions to check permissions
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

BossOfGames

Not exactly what I am after. Yes, I am using a page with authentication, however, I need the external web application to authenticate through SMF. Let me outline it.


  • User goes to sub domain of the web application (which is separate from SMF entirely)
  • User logs into the web application via a login prompt.
  • Web Script (in php) calls my SMF database to authenticate directly with the database
  • If successful, the user goes through to the rest of the site

The devices that are accessing this application are highly limited in their functionality so the SSI.php would not pertain to this. I do not want (nor need) my users going to the forum website to authenticate and then go to my application hosted on a different sub domain. So would modifying the LogInOut.php file for my web application be the easiest way to handle this? Or is there something else I am missing? I want to keep all my user's login information all in one place so I don't have to have my users keep creating accounts for all my different services. I have a total of 4 different services that I am interlinking into a one account system.

margarett

OK so you just need to fetch the hashed password from SMF's database (smf_members) for the username requested.

Then hash the user+password that the user entered like SMF does --> sha1(strtolower($_POST['username']) . $_POST['password']) and compare it with the hash you got from the database. If equal, login on your application ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

I don't think that is necessary, margarett...

Using ssi_login should enable you to do all of that without writing extra code or extra sql....

Just turn on the subdomain independent cookies in the server settings and you can use the smf login routine and cookie, even on your separate subdomain...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

he says that...  but I don't think he understands what SSI allows...

this is a case of the user insisting on something overly complicated because he doesn't understand how the system works.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: