diff options
Diffstat (limited to 'zenserver/zenserver.cpp')
| -rw-r--r-- | zenserver/zenserver.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index c6a27ec44..bd4a3c1cf 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -99,6 +99,7 @@ ZEN_THIRD_PARTY_INCLUDES_END // #include "admin/admin.h" +#include "auth/authmgr.h" #include "auth/authservice.h" #include "cache/structuredcache.h" #include "cache/structuredcachestore.h" @@ -203,9 +204,13 @@ public: m_Http = zen::CreateHttpServer(ServerOptions.HttpServerClass); int EffectiveBasePort = m_Http->Initialize(ServerOptions.BasePort); - m_AuthService = std::make_unique<zen::HttpAuthService>(); + m_AuthMgr = MakeAuthMgr({.RootDirectory = m_DataRoot / "auth"}); + m_AuthService = std::make_unique<zen::HttpAuthService>(*m_AuthMgr); m_Http->RegisterService(*m_AuthService); + m_AuthMgr->AddOpenIdProvider( + {.Name = "Okta"sv, .Url = "https://epicgames.okta.com/oauth2/auso645ojjWVdRI3d0x7"sv, .ClientId = "0oapq1knoglGFqQvr0x7"sv}); + m_Http->RegisterService(m_HealthService); m_Http->RegisterService(m_StatsService); m_Http->RegisterService(m_StatusService); @@ -529,6 +534,7 @@ private: } zen::Ref<zen::HttpServer> m_Http; + std::unique_ptr<zen::AuthMgr> m_AuthMgr; std::unique_ptr<zen::HttpAuthService> m_AuthService; zen::HttpStatusService m_StatusService; zen::HttpStatsService m_StatsService; @@ -696,7 +702,7 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions) } m_UpstreamCache = zen::MakeUpstreamCache(UpstreamOptions, *m_CacheStore, *m_CidStore); - m_UpstreamService = std::make_unique<HttpUpstreamService>(*m_UpstreamCache); + m_UpstreamService = std::make_unique<HttpUpstreamService>(*m_UpstreamCache, *m_AuthMgr); m_UpstreamCache->Initialize(); if (ServerOptions.UpstreamCacheConfig.CachePolicy != UpstreamCachePolicy::Disabled) @@ -785,7 +791,7 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions) if (!Options.ServiceUrl.empty()) { - std::unique_ptr<zen::UpstreamEndpoint> JupiterEndpoint = zen::MakeJupiterUpstreamEndpoint(Options); + std::unique_ptr<zen::UpstreamEndpoint> JupiterEndpoint = zen::MakeJupiterUpstreamEndpoint(Options, *m_AuthMgr); m_UpstreamCache->RegisterEndpoint(std::move(JupiterEndpoint)); } } |