News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Create an account and log a user in using PHP?

Started by Steve5451, April 26, 2015, 11:22:09 PM

Previous topic - Next topic

Steve5451

I want to use OpenID and the Steam API to allow users to log in through steam, creating an account and logging them in automatically. Right now signing in through steam can send the server information like steamID, profile URL, username, etc.
How can I use PHP to create a new account with this information, and how can I use PHP to log them into the new account?

As for logging in later, I was thinking maybe after signing in through steam, the API will give a steamID, the forum will look it up in the member table, and log in whichever members that ID belongs to.

LiroyvH

Hi,

Welcome. :)
Please use the search function here first next time, before asking your question. :)
There's been multiple discussions about this, so plenty to find that you can read up on and get what you want.

I think this will get you what you want:
https://github.com/live627/smf-steam-auth
((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

Steve5451

Quote from: CoreISP on April 26, 2015, 11:27:48 PM
Hi,

Welcome. :)
Please use the search function here first next time, before asking your question. :)
There's been multiple discussions about this, so plenty to find that you can read up on and get what you want.

I think this will get you what you want:
hxxp:github.com/live627/smf-steam-auth [nonactive]

Thank you, but I've tried this before and it just wasn't quite the level of integration I needed, and I'd rather not try to work on top of another mod.
I forgot to add that I'm using 2.0.9.

For what I'm working on I just need some kind of function to log any a given user in (not with username/password, but the information verified via the Steam API). Thanks.  :)

EDIT: I think what I'm looking for is how to generate a SMFCookie to give the user that'll log them in.

Kindred

It's not that simple...   Every user in smf must have an entry in the smf table smf_members...  So, not only would you have to handle login, associating a steam ID to an smf user account, but you would also have the create a new account in smf when a user with a steamID connects and does not have a linked account inside smf.
Сл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."

Steve5451

Quote from: Kindred on April 27, 2015, 12:41:46 AM
It's not that simple...   Every user in smf must have an entry in the smf table smf_members...  So, not only would you have to handle login, associating a steam ID to an smf user account, but you would also have the create a new account in smf when a user with a steamID connects and does not have a linked account inside smf.

I've already made it store the user's SteamID in smf_members once you "connect" your Steam account, I just need to know how I might login a client with an account who's SteamID matches that provided by the Steam API.

Kindred

Probably by using the smf API functions, or writing Some code to tag into the smf functions using the smf hooks...
Сл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."

Advertisement: