aboutsummaryrefslogtreecommitdiff
path: root/zenserver/auth/authmgr.h
blob: 1138d9effecdbb267742ea43cb411011c693e2f5 (plain) (blame)
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
// Copyright Epic Games, Inc. All Rights Reserved.

#include <zencore/string.h>

#include <filesystem>
#include <memory>

namespace zen {

class AuthMgr
{
public:
	virtual ~AuthMgr() = default;

	struct AddOpenIdProviderParams
	{
		std::string_view Name;
		std::string_view Url;
		std::string_view ClientId;
	};

	virtual void AddOpenIdProvider(const AddOpenIdProviderParams& Params) = 0;

	struct AddOpenIdTokenParams
	{
		std::string_view ProviderName;
		std::string_view IdentityToken;
		std::string_view RefreshToken;
		std::string_view AccessToken;
	};


	virtual bool AddOpenIdToken(const AddOpenIdTokenParams& Params) = 0;

	struct OpenIdAccessToken
	{
		std::string AccessToken;
	};

	virtual OpenIdAccessToken GetOpenIdAccessToken(std::string_view ProviderName) = 0;
};

struct AuthConfig
{
	std::filesystem::path RootDirectory;
};

std::unique_ptr<AuthMgr> MakeAuthMgr(const AuthConfig& Config);

}  // namespace zen