1#ifndef TENDUKE_OIDC_AUTODISCOVERY_H
2#define TENDUKE_OIDC_AUTODISCOVERY_H
4#include "../OIDCConfiguration.h"
6#include "crypto/PublicKey.h"
7#include "http/HTTPClient.h"
8#include "json/JSONObject.h"
9#include "json/JSONParser.h"
11#include "jwk/JWKSParser.h"
12#include "oauth/OAuthBackendConfiguration.h"
13#include "utl/Base64Decoder.h"
39 std::shared_ptr<const tenduke::oauth::OAuthBackendConfiguration> oauthConfiguration,
40 std::shared_ptr<const tenduke::oidc::OIDCConfiguration> oidcConfiguration,
41 std::string jwksDocument
42 ) : oauthConfiguration(std::move(oauthConfiguration)), oidcConfiguration(std::move(oidcConfiguration)), jwksDocument(std::move(jwksDocument))
49 std::shared_ptr<const tenduke::oauth::OAuthBackendConfiguration>
getOAuthConfiguration()
const {
return oauthConfiguration;}
58 std::shared_ptr<const tenduke::oidc::OIDCConfiguration>
getOOIDCConfiguration()
const {
return oidcConfiguration;}
61 const std::shared_ptr<const tenduke::oauth::OAuthBackendConfiguration> oauthConfiguration;
62 const std::shared_ptr<const tenduke::oidc::OIDCConfiguration> oidcConfiguration;
63 const std::string jwksDocument;
78 std::shared_ptr<const tenduke::http::HTTPClient> httpClient,
79 std::shared_ptr<const tenduke::json::JSONParser> jsonParser,
80 std::shared_ptr<const tenduke::jwk::JWKSParser> jwksParser
155 const std::shared_ptr<const tenduke::http::HTTPClient> http;
156 const std::shared_ptr<const tenduke::json::JSONParser> parseJson;
157 const std::shared_ptr<const tenduke::jwk::JWKSParser> parseJWKS;
Result of OIDC auto-configuration query.
Definition AutoDiscovery.h:28
std::shared_ptr< const tenduke::oauth::OAuthBackendConfiguration > getOAuthConfiguration() const
Returns discovered OAuth-configuration.
Definition AutoDiscovery.h:49
AutoDiscoveryResult(std::shared_ptr< const tenduke::oauth::OAuthBackendConfiguration > oauthConfiguration, std::shared_ptr< const tenduke::oidc::OIDCConfiguration > oidcConfiguration, std::string jwksDocument)
Constructs new instance.
Definition AutoDiscovery.h:38
std::shared_ptr< const tenduke::oidc::OIDCConfiguration > getOOIDCConfiguration() const
Returns the discovered OIDC-configuration WITHOUT the signing key.
Definition AutoDiscovery.h:58
Service for querying OIDC configuration from known URL.
Definition AutoDiscovery.h:69
virtual AutoDiscoveryResult discover(const std::string &url) const
Performs OIDC configuration auto discovery.
Definition AutoDiscovery.cpp:57
virtual std::shared_ptr< const tenduke::oidc::OIDCConfiguration > toOIDCConfiguration(const AutoDiscoveryResult &result) const
Returns the discovered OIDC-configuration, with default verification key.
Definition AutoDiscovery.cpp:115
virtual std::string downloadJWKSDocument(const std::string &jwks_uri) const
Makes HTTP-call to given URL, and downloads the JWKS-document.
Definition AutoDiscovery.cpp:96
AutoDiscovery(std::shared_ptr< const tenduke::http::HTTPClient > httpClient, std::shared_ptr< const tenduke::json::JSONParser > jsonParser, std::shared_ptr< const tenduke::jwk::JWKSParser > jwksParser)
Constructs new instance.
Definition AutoDiscovery.cpp:21
virtual std::unique_ptr< const tenduke::jwk::JWK > getDefaultVerificationKey(const AutoDiscoveryResult &result) const
Returns the default verification key from tenduke::oauth::oidc::AutoDiscoveryResult.
Definition AutoDiscovery.cpp:134
virtual std::unique_ptr< tenduke::jwk::JWKS > getVerificationKeys(const AutoDiscoveryResult &result) const
Returns the verification keys from tenduke::oauth::oidc::AutoDiscoveryResult.
Definition AutoDiscovery.cpp:129
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7