smith197 / steamauthentication Goto Github PK
View Code? Open in Web Editor NEWA simple PHP Authentication that enables steam users to log into their steam account to access content!
License: MIT License
A simple PHP Authentication that enables steam users to log into their steam account to access content!
License: MIT License
After about three month the demo site is still unavailable.
I would continue hosting it on my own server if thats an option.
Hello, I am making a TF2 trading website and everything works fine when i'm not logged in. But when i log-in this doesn't echo:
require 'steamauth/steamauth.php';
require 'steamauth/userInfo.php';
if (!isset($_SESSION['steamid'])) {
echo "You need to log-in first.";
}
else {
echo "Test";
}
There is a typo that makes it harder to understand part of the installation process.
The following error code may occur when attempting to sign in:
Warning: Cannot modify header information - headers already sent by (output started at /index.php:10) in /steamauth/steamauth.php on line 19
This issue is currently occurring on the demo site, I will attempt to fix it as soon as possible!
As far as I can see, you're using a pretty old version in the demo page. Even tho it works, i would recommend updating it for performance reasons and to show new stuff eventually.
#66 completely broke the link-generation.
The way @MeLlamoPablo wanted to carry $_GET-variables through the steam login-screen is not possible since steam strips them from the string.
Already working on a fix.
In the config file this does not do anything:
$steamauth['loginpage'] = "../logincheck/";
Im having issues putting a logout button on a seperate page.
I have a cover page where the user logs in and is then redirected to the main page. But the logout button on that page does not work.
e.g.
test.com?test=1
test.com?test=2
After logging in, this error always displayed (and it has a typo):
"Error: failed to fetch content form Steam. It may be down. Please, try again later."
...and the logout button is not displayed, so I have to comment out the "include('steamauth/userInfo.php'); line to get the logout button back once I've attempted to log in already.
Hi Guys, If I try to do:
<?php
require ('steamauth/steamauth.php');
include ('steamauth/userInfo.php');
if(!isset($_SESSION['steamid'])) { }
else {
$userdbfile = file('userfiles/' . $steamprofile['steamid'] . '.txt');
}
?>
I get:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at %path%/public_html/beta/index.php:2) in %path%/steamauth/steamauth.php on line 2
(%path is replaced with the path..)
Thanks for everything, Keep up the work!
I am always getting the User is not logged in error. Is this something with steam? I already tried the older versions but those also aren't working.
Do you know what is causing this error?
What is the license of the library?
You did really good job there. Good work :), but unfortunately it doesn't work for me :(.
I followed your instructions and used example.php as my index.php. When I click "Sign in through steam" it doesn't redirect to the steam page, but it shows me "Couldn't connect to host".
By the way, does SteamAuthentication use curl? Maybe that's the problem becouse my hosting doesn't support it.
It gives a error log if the user is not logged in PHP Notice: Undefined index: lastlogoff in. So for example someone clicks on the profile page and not logged in the error will show up. But it wont if the person is logged in. Any idea why this is happening?
Hi i needed to implement a steam login in my webpage and this project solved my problems, but now i got an issue. It worked well in "static" pages but when i need to login from a page that need an initial "get value" like a search page it simply doesn't work. When i hit the login button the page ask me for a value to search and doesn't proceed to the login redirect.
The problem is that the button calls a "?login" form action and it clear the get values of the actual page.
Thanks!
PD: I'm using 2.1.3 release.
is there any way i can get the steamid of a user and store it in my mysql database as soon as he logs in?
Hi ^^
I need a "remember me login" feature on my website, can you help me ?
Currently logout.php will redirect you to a page a directory above the actual target.
You can easily fix that with modifying logout.php at line 3 to look like this:
header("Location: ./".$logout_page);
So far the plugin works great but I get the following error.PHP Notice: A session had already been started - ignoring session_start() in would be nice if it didn't show up that seems to be the only error in this script you got.
I'm having a problem where the session times out extremely fast. How can I increase session time of SteamAuth or make the session permanent? I understand you aren't obligated to give support but this really is a simple thing that nobody on Stackoverflow wants to help me with.
Hello everyone,
I am wondering if it is possible to use this tool to get Steam Achievement data. Achievement data can be found at the following location below. This is just an example for a single game. XXXXXX is the developer key.
If the dev key is entered, you'll see my personal achievements and stats for this game. However, if my profile were private, I would not be able to pull achievement or statistical data. Is there any way around this using this tool? I know Steam Authentication normally can get you achievement info.
Thanks.
Hey,
Wonderful plugin youve got here...just curious, what is the best way to get dynamic vars to passthrough after account log in? such as if my url var was:
$url = "http://www.example.com/index.php?status=".$dbstatus
where $dbstatus would be fetched dynamically from a DB on a per user basis.
hello , thx for this plgin .
i want to use this web api : http://api.steampowered.com/IDOTA2Match_/GetTournamentPlayerStats/v1
can you make this for me ?
doc : https://wiki.teamfortress.com/wiki/WebAPI/GetTournamentPlayerStats
i have followed the instructions and have changed api key in both the places still getting this error.
welcome guest! please login error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
[removed]
Hi, I put a login button in the index.php but it's doing nothing and get stuck on /?login.
It work on the example.php but not on the index.php
Besides the mysql errors you have in 50 other issues probably, I keep getting this one:
Warning: file_get_contents(http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=&steamids=): failed to open stream: Connection timed out in /home/ibreakzo/public_html/libs/steamauth/userInfo.php on line 4
If there is any known fix for this that I cannot seem to find (I have been doing hours of research, literally), PLEASE let me know.
Thank you and have a wonderful rest of your afternoon!
Try clicking the login button and the below comes up:
Warning: Cannot modify header information - headers already sent by (output started at /home/bensmith/public_html/steam/index.php:24) in /home/bensmith/public_html/steam/steamauth/steamauth.php on line 24
Still investigating!
(Sorry, new to site and php!)
Directories are correct but when I try to log in, I get redirected to the steam website, log in, then redirected back, only to see "welcome guest! please login User is not logged in.". Its not running the code inside this if statement? if($openid->validate())
Probably not an issue but me being dumb but help would be appreciated :)
I get these errors in my log whenever I try and use PHP to submit to the DB
Errors:
PHP Notice: Undefined variable: _SESSION in /home11/example/public_html/steamauth/userInfo.php on line 4
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 6
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 7
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 8
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 9
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 10
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 11
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 12
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 13
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 14
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 15
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 21
PHP Notice: Undefined offset: 0 in /home11/example/public_html/steamauth/userInfo.php on line 22
PHP code:
<?php
include ('steamauth/userInfo.php');
$servername = "myserver";
$username = "myname";
$password = "mypass";
$dbname = "mydb";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql="INSERT INTO enterw (weekly) VALUES ('" . $steamprofile['steamid'] . "')";
if ($conn->query($sql) === TRUE) {
echo "Success";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
As a result I only get 0 submitted to the DB, how would I go about fixing this?
After Steam authentication, I get a 302 redirection loop. It will occasionally work, but for the most part a Ctrl+F5 is what it takes to make it go through. It happens in Firefox 33.1 and Chrome 39, but not in Explorer 11.
It's just a note, but if someone updates the steam persona directly in a mysql_query (without using mysql_real_escape_string like me :( ), if the persona contains an ' mark, it'd override everyone's persona in the database, or even worse.
I will get round to sorting this out, sorry!
First of all, great work, it works great!
Well it does in a standalone application.
I'm trying to get this to work with CodeIgniter, and I sort of did it but can only use the session variables ($_SESSION['steamid'], etc) and not the $steamprofile variable.
I've put the files in the "helper" directory, renamed "steamauth.php" to "steamauth_helper.php", and made it auto load. Then I copied the code from "userInfo.php" and pasted it in "steamauth_helper.php" inside the "if($openid->validate())" section (so it is run when logged in successful).
Like I said: it properly shows the button, logs me in and everything, but I can only use the session variables.
Is it maybe possible to make a proper hook or library from this that I can use? Yes it works but it feels kinda like a hack which I rather not do when possible.
Hi there! This code is exactly what I need for my website I'm grateful that you have made it available, though as of now, I can't get it to work. I have followed all the instructions and have come to no fruition.
With everything set as I believe it should be, when I test my site I get just a blank page.
I don't believe this is an error on my side, but if it is, sorry for reporting it as an error in code.
If you wish to check my files to see this is a new coding error, here they are:
Settings.PHP : http://gyazo.com/5ad364462a8be46ea0cc91472d97f08f
DreamWeaver File & Code : http://gyazo.com/c0441de71442cf68b53323d6b10e0385
Result when run : http://gyazo.com/7bc06fb723bb1281681358b0f4902c36
I also tested the demo code, and the button and steam login also didn't work.
Demo.html : http://gyazo.com/2e6250192a7e8d3c417e3359bb42e8e0
The rest of the .PHP files are unchanged.
Hey, Im just wondering on what websites this is used, So I just can get some inspiration (I wont steal :P)
๐ด <-- smoke weed every day
If the user didn't set his realname, the steam api won't show it in the content, and a notice "Undefined index: realname in .." will be displayed. Not a big issue, but worth fixing it with isset.
Truth is not about any of this, I need to know how to create ?login page: example: http://bensmith.in/steam/?login
Does not work. Removing the dot before the header works!
When i click on login button it wont re-direct to the steam login page. it simply goes to http://localhost/gamerzkit/?login show home page only. Any suggestions?
Since the version since the pull request is NOT backward-compatible with the previous versions, i would suggest finally creating a new release.
hi ,
sry for bad english .
i need use your SteamAuth in wordpress pls tell me how to use ?
If I use this, I get the error "No OpenID Server found at http://steamcommunity.com/openid"
How to fix it, It just replaces the button with this whenever you press on it, after 1 minute waiting..
Thanks to all the makers, You are amazing! It worked before..
Hey i recently found thius and tried to get it all working and whatnot, i managed to get it so you can click "Login with steam", then login from the demo page, but when after i click "Log In" from the steam page it takes a decent ammount of time to load and then gives me this error:
Warning: file_get_contents(http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=[REMOVED_BY_SmItH197]&steamids=76561198181922383): failed to open stream: Connection timed out in /home/csgomark/public_html/steamauth/userInfo.php on line 4
Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/csgomark/public_html/steamauth/userInfo.php on line 9
Warning: mysql_real_escape_string(): Access denied for user 'root'@'localhost' (using password: NO) in /home/csgomark/public_html/steamauth/userInfo.php on line 9
Warning: mysql_real_escape_string(): A link to the server could not be established in /home/csgomark/public_html/steamauth/userInfo.php on line 9
If you could tell me what im doing wrong i would really apprecite it as i cant find the answer anywhere else and i am fairly new to this.
Also i am using a free hosting site to host this - X10hosting - They support mysql and have databases and stuff, sorry for being a pain...
Thanks,
Cam
Hello,
My question is in regards to this step in steamauth.php:
Now find $api_key on line 5 and set it to the api key you got from http://steamcommunity.com/dev/apikey .
I don't see the need for it, the variable $api_key is never used. The only time $api_key is needed is in userinfo.php.
Let me know if I'm wrong! Great script overall, thank you!
The title says most of my issue... I managed to set it up to work on my localhost using xampp. However when I upload it and click the login button, I return to the same url with "?login" tacked at the end (of the url). I am not sure what the issue is, I changed setting to redirect to my domain name (and not local host), but I am without a clue.
Here's some of my host's info: http://i.imgur.com/kpJWCEZ.png
And here's a link to my site, with the issue: http://potders.com/awesome-stats/
Following errors:
Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/public_html/steamauth/userInfo.php on line 9
Warning: mysql_real_escape_string(): Access denied for user 'root'@'localhost' (using password: NO) in /home/public_html/steamauth/userInfo.php on line 9
Warning: mysql_real_escape_string(): A link to the server could not be established in /home/public_html/steamauth/userInfo.php on line 9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.