summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/api/login.h
blob: ece955840da799b916ad8d3476a62040e9580ba1 (plain)
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
#ifndef _STEAM_REQUEST_LOGIN_H_
#define _STEAM_REQUEST_LOGIN_H_

class LogonRequest : public HttpRequest
{
public:
	LogonRequest(const char *token) :
		HttpRequest(REQUEST_POST, "/ISteamWebUserPresenceOAuth/Logon/v0001")
	{
		char data[256];
		mir_snprintf(data, "access_token=%s&ui_mode=web", token);

		this
			<< CHAR_PARAM("access_token", token)
			<< CHAR_PARAM("ui_mode", "web");
	}

	//{
	//	"steamid": "XXXXXXXXXXXXXXXXX",
	//	"error" : "OK",
	//	"umqid" : "XXXXXXXXXXXXXXXXXXX",
	//	"timestamp" : 16955891,
	//	"utc_timestamp" : 1514974537,
	//	"message" : 1,
	//	"push" : 0
	//}

};

class LogoffRequest : public HttpRequest
{
public:
	LogoffRequest(const char *token, const char *umqId) :
		HttpRequest(REQUEST_POST, "/ISteamWebUserPresenceOAuth/Logoff/v0001")
	{
		this
			<< CHAR_PARAM("access_token", token)
			<< CHAR_PARAM("umqid", umqId);
	}

	//{
	//	"error": "OK"
	//}
};

#endif //_STEAM_REQUEST_LOGIN_H_