iFun Engine API  1.0.0-b5770
Great Technology for Great Games
nexon_platform_authentication.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2020 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_SERVICE_NEXON_PLATFORM_AUTHENTICATION_H_
10 #define INCLUDE_FUNAPI_SERVICE_NEXON_PLATFORM_AUTHENTICATION_H_
11 
12 #include <funapi/common/json.h>
13 #include <funapi/types.h>
14 
15 
16 namespace fun {
17 
18 struct FUNAPI_DLL_VISIBILITY NexonPlatformError {
20  NexonPlatformError(const string &code,
21  const string &type,
22  const string &message);
23 
24  string code;
25  string type;
26  string message;
27 };
28 
29 
30 struct FUNAPI_DLL_VISIBILITY NexonPlatformAuthenticationRequest {
31  explicit NexonPlatformAuthenticationRequest(const string &client_ticket);
32 
33  string client_ticket;
34 };
35 
36 
37 struct FUNAPI_DLL_VISIBILITY NexonPlatformAuthenticationResponse {
39 
40  NexonPlatformAuthenticationResponse(const string &user_no,
41  const string &token,
42  const string &refresh_token,
43  int64_t expires_in,
44  const Json &extra_data);
45 
46  explicit NexonPlatformAuthenticationResponse(const NexonPlatformError &error);
47 
48  bool success;
49  string user_no;
50  string token;
51  string refresh_token;
52  int64_t expires_in;
53  Json extra_data;
54 
55  NexonPlatformError error;
56 };
57 
58 
59 typedef function<void(const NexonPlatformAuthenticationRequest &request,
61  bool error)> NexonPlatformAuthenticationResponseHandler;
62 
63 FUNAPI_DLL_VISIBILITY
64 void Authenticate(const NexonPlatformAuthenticationRequest &request,
65  const NexonPlatformAuthenticationResponseHandler &handler,
66  size_t timeout_in_ms = 0);
67 
68 FUNAPI_DLL_VISIBILITY
69 bool AuthenticateSync(const NexonPlatformAuthenticationRequest &request,
71 
72 } // namespace fun
73 
74 #endif // INCLUDE_FUNAPI_SERVICE_NEXON_PLATFORM_AUTHENTICATION_H_
Definition: nexon_platform_authentication.h:37
Definition: nexon_platform_authentication.h:18
Definition: json.h:18
Definition: nexon_platform_authentication.h:30
Definition: json.h:27