You are not logged in.

Dear visitor, welcome to sourceserver.info. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Sunday, August 12th 2012, 10:20pm

forum per steamlogin

hallo zusammen

meine frage hat nicht viel mit css server zu tun, aber mit steam

:/

ich bin auf der suche nach einer möglichkeit/hilfe/tips ect., wir ich ein forum (SMF 2.0.2) so einrichten kann, das man nur einen login button per steam hat
das man sich quasi per steam (openid api) einloggt und dann zum forum weiter/zurück geleitet wird


das es möglich ist sieht man z.b hier http://manncotrading.com und andere webseite haben das login prinzip auch

das man bei steam ein api key braucht ist bekannt
aber man braucht wohl auch noch einen openid key/anbieter

hab schon einige zeit im smf forum gesucht, dort wird immer wieder nur auf das openid hingewiesen
bei meiner testinstall vom forum hab ich das openid ja auch bei nur peile ich nicht ganz wie es dann weitergeht

:(

grüsse
Customer Support by 4NetPlayers
KEIN Support per TS3,PN
KEIN Support für MANI + Eventscripts

2

Sunday, August 12th 2012, 10:43pm

Seite schon registriert?
Da solltest du auch deine Informationen zu diesem Thema bekommen.
+88_________________+880______
_+880_______________++80______
_++88______________+880_______
_++88_____________++88________
__+880___________++88_________
__+888_________++880__________
__++880_______++880___________
__++888_____+++880____________
__++8888__+++8880++88_________
__+++8888+++8880++8888________
___++888++8888+++888888+80____
___++88++8888++8888888++888___
___+++++888888fx8888888888__
____++++++888888888888888888__
_____++++++++000888888888888__
_____+++++++00008f8888888888__
______+++++++00088888888888___
_______+++++++0888f8888888____
_______+++++++08888l888888____
________+++++++8888888888_____

Ich bin das Arschloch das dir direkt die Meinung sagt, um dir die Peinlichkeit zu ersparen.

3

Sunday, August 12th 2012, 11:19pm

naja muss ja noch nicht reggen

aber die dev seite hab ich schon gesehen
hab nur das übersehen das ich da wohl auch was in der "httpd.conf" ändern muss, geht nur nicht wenn man keinen rootserver hat
hat sich damit wohl erstmal erledigt

wobei das smf forum ja schon einen openid support hat

:/
Customer Support by 4NetPlayers
KEIN Support per TS3,PN
KEIN Support für MANI + Eventscripts

Impact

Super Moderator

Posts: 1,276

wcf.user.option.userOption53: Nein

  • Send private message

4

Sunday, August 12th 2012, 11:31pm

Ich nutze diese Klasse hier zum Authentifizieren von Accounts bzw Steamids, einen Apikey braucht man nur um zB den Namen/Avatar etc zu einer Id zu bekommen.
Einen Provider oder ähnliches braucht es dazu ebenfalls nicht (Steam ist der Provider, das Forum der Client), genauso wenig wie einen Eintrag in einer Config des Apachedaemon.

Quoted

Admin>Registration>settings>Allow users to register using OpenID

Wenn dir das nicht genügt kannst du dir mit der verlinkten Klasse auch selbst etwas basteln.

MfG
Impact

5

Monday, August 13th 2012, 12:36am

also im forum ist unter setting das openid aktiv und wenn man sich einloggen will gibt es auch ein extra feld dazu
aber der "login" soll ja "eigendlich" von steam kommen

aber irgenwdie kann das doch nicht so sein da es "nur" ein link ist der mit dem openid zu steam führt und wieder zurückleitet oder ?


*das ich immer so tolle ideen hab :(
Customer Support by 4NetPlayers
KEIN Support per TS3,PN
KEIN Support für MANI + Eventscripts

popoklopsi

Beginner

Posts: 23

wcf.user.option.userOption53: Nein

  • Send private message

6

Tuesday, August 14th 2012, 11:52pm

Mit PHP Tag stopft es alles in eine Zeile, also schicke ich es dir nur in einem Spoiler, hier der Code, der bei mir geht:

Spoiler Spoiler


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php

function genUrl($returnUrl)
{
	$returnUrl = (!$returnUrl) ? (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] : $returnUrl;
	
	$params = array(
 'openid.ns' => 'http://specs.openid.net/auth/2.0',
 'openid.mode' => 'checkid_setup',
 'openid.return_to'	=> $returnUrl,
 'openid.realm' => (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'],
 'openid.identity'	=> 'http://specs.openid.net/auth/2.0/identifier_select',
 'openid.claimed_id'	=> 'http://specs.openid.net/auth/2.0/identifier_select',
	);
	
	$sep = '&amp;';
	return 'https://steamcommunity.com/openid/login?' . http_build_query($params, '', $sep);
}

function validate()
{
	session_start();
	
	if (isset($_SESSION['HTTP_USER_AGENT']))
	{
 if ($_SESSION['HTTP_USER_AGENT'] != md5($_SERVER['HTTP_USER_AGENT']))
 {
 logout();
 return false;
 }
	}
	
	if (!isset($_SESSION['stamm_steamid64']))
	{
 if(isset($_COOKIE['stamm_steamid64']))
 {
 session_regenerate_id();
 $_SESSION['stamm_steamid64'] = $_COOKIE['stamm_steamid64'];
 $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);
 
 return true;
 }
	
	}
	else return true;
	
	if (!isset($_GET['openid_signed'])) return false;
	
	$params = array(
 'openid.assoc_handle'	=> $_GET['openid_assoc_handle'],
 'openid.signed' => $_GET['openid_signed'],
 'openid.sig' => $_GET['openid_sig'],
 'openid.ns' => 'http://specs.openid.net/auth/2.0',
	);
	

	$signed = explode(',', $_GET['openid_signed']);
	
	foreach($signed as $item)
	{
 $val = $_GET['openid_' . str_replace('.', '_', $item)];
 $params['openid.' . $item] = get_magic_quotes_gpc() ? stripslashes($val) : $val; 
	}

	$params['openid.mode'] = 'check_authentication';
	
	$data = http_build_query($params);
	
	$context = stream_context_create(array(
 'http' => array(
 'method' => 'POST',
 'header' => 
 "Accept-language: en\r\n".
 "Content-type: application/x-www-form-urlencoded\r\n" .
 "Content-Length: " . strlen($data) . "\r\n",
 'content' => $data,
 ),
	));

	$result = file_get_contents('https://steamcommunity.com/openid/login', false, $context);
	
	preg_match("#^http://steamcommunity.com/openid/id/([0-9]{17,25})#", $_GET['openid_claimed_id'], $matches);
	$steamID64 = is_numeric($matches[1]) ? $matches[1] : 0;

	$steamid64_finish = preg_match("#is_valid\s*:\s*true#i", $result) == 1 ? $steamID64 : '';
	
	if(!empty($steamid64_finish))
	{
 session_regenerate_id (true);
 
 $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);
 $_SESSION['stamm_steamid64'] = $steamid64_finish;
 
 setcookie("stamm_steamid64", $_SESSION['stamm_steamid64'], time()+60*60*24*10, "/");
 
 return true;
	}
	
	return false;
}

function calculate_steamid()
{
	$commid = $_SESSION['stamm_steamid64'];
	
	if (substr($commid, -1)%2 == 0) $server = 0; 
	else $server = 1;
 
	$auth = bcsub($commid, '76561197960265728');
	
	if (bccomp($auth, '0') != 1) return "";
	
	$auth = bcsub($auth, $server);
	$auth = bcdiv($auth, 2);
	
	return 'STEAM_0:'.$server.':'.$auth;
}

function curPageURL()
{
	$pageURL = 'http';
	
	if ($_SERVER["HTTPS"] == "on") $pageURL .= "s";
	
	$pageURL .= "://";
	
	if ($_SERVER["SERVER_PORT"] != "80") $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
	else $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
	
	return $pageURL;
}

if (validate())
{
	$steamid = calculate_steamid();
	echo "thanks for logging in, your Steamid is $steamid";
}
else
{
	$url = genUrl(curPageURL());
	
	echo '<a href="'.$url.'"><img src="http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_small.png" /></a>';
}
?>