Files
backend/common/OidcRpConfig.h
T

45 lines
1.1 KiB
C++

#pragma once
#include <json/json.h>
#include "common/OidcJwt.h"
#include <string>
#include <vector>
namespace visione::oidc
{
struct RpProviderConfig
{
std::string issuer;
std::string trustAnchor;
std::string profile;
};
struct RpConfig
{
bool enabled{false};
std::string baseUrl;
std::string clientId;
std::string redirectUri;
std::string postLoginRedirectUri;
std::string organizationName;
std::string clientName;
std::vector<std::string> contacts;
std::string jwksPath;
std::string federationJwksPath;
std::vector<std::string> trustAnchors;
std::vector<RpProviderConfig> providers;
std::vector<Jwk> federationJwks;
std::vector<Jwk> coreJwks;
Json::Value trustMark;
};
RpConfig loadRpConfig();
Json::Value rpMetadataDocument(const RpConfig &config);
Json::Value rpPublicJwksDocument(const RpConfig &config);
Json::Value entityConfigurationDocument(const RpConfig &config);
std::optional<RpProviderConfig> findProviderConfig(const RpConfig &config,
const std::string &provider);
} // namespace visione::oidc