Download the PHP package jacobfitz/steamauth without Composer
On this page you can find all versions of the php package jacobfitz/steamauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jacobfitz/steamauth
More information about jacobfitz/steamauth
Files in jacobfitz/steamauth
Package steamauth
Short Description Implement Steam login within your PHP project
License MIT
Informations about the package steamauth
SteamAuth
SteamAuth allows you to implement steam sign-in within your PHP project. \ It is simple, fast, and secure...
Installation
Install with composer:
Request
To log a user in you must first make a request.
API_KEY - This is your steam developer API key, you can find it by going to https://steamcommunity.com/dev/apikey
\
RETURN_URL - The URI on your website where the user will be returned to on successful login. For example if your website is example.com and you want to proccess the response on example.com/proc_login, you will only need to pass proc_login
to the request constructor - Do not use full URL's!
The user will be redirected to the steam login page, once they sign in with their steam account they will be returned to the return URL specified with a response from steam.
Note: If you choose to use a steam login button you must consult and adhere to the steam brand guidelines.
Response
When the user is returned to your site after logging in with steam you will need to handle the response, an example of how this is done can be found bellow.
User
Once a request has been made, and the response has been handled you will be able to access information about the user.
SteamAuth comes with a handy class to make working with the steam user easy, but if you prefer to use your own implementation you can get all the information you need from the $_SESSION['steamAuth']
variable.
Check if the user is logged in
To check if a steam user is currently logged in you can do:
Get the user
To get a currently logged-in user you can do:
Reload the user
User details are not automatically updated, meaning it may be necessary to fetch the latest information from steam. This can be done by simply doing:
Get user information
To get information about a user you can use a variety of methods. Bellow is an example of how each can be used: