10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::oidc::BaseOIDCClient Class Reference

#include <BaseOIDCClient.h>

Detailed Description

Base-class for OIDC-clients.

Inheritance diagram for tenduke::oidc::BaseOIDCClient:
tenduke::oidc::OIDCClient tenduke::oidc::DefaultOIDCBrowserFlow tenduke::oidc::device::DefaultOIDCDeviceFlow

Public Member Functions

 BaseOIDCClient (const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const std::shared_ptr< const tenduke::oauth::OAuthClient > &oauthClient, const std::shared_ptr< const tenduke::jwt::JWTParser > &jwtParser, const std::shared_ptr< const tenduke::http::HTTPClient > &httpClient)
 Constructs new instance.
 
std::unique_ptr< const tenduke::oidc::OIDCRefreshRequestrefresh (const std::shared_ptr< tenduke::oidc::OIDCState > &state) const override
 Refreshes the OIDC state.
 
std::string requestUserinfo (const std::string &accessToken) const override
 Requests user information from "userinfo"-endpoint.
 

Static Protected Member Functions

static std::string ensureOpenIDScope (const std::string &scopes)
 Checks if provided scopes have openid among them.
 

Protected Attributes

const std::shared_ptr< const tenduke::oidc::OIDCConfigurationoidcConfiguration
 OIDC-configuration.
 
const std::shared_ptr< const tenduke::jwt::JWTParserparseJWT
 JWT-parse for parsing ID-token.
 
const std::shared_ptr< const tenduke::http::HTTPClienthttp
 HTTP-client.
 

Constructor & Destructor Documentation

◆ BaseOIDCClient()

tenduke::oidc::BaseOIDCClient::BaseOIDCClient ( const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > &  oidcConfiguration,
const std::shared_ptr< const tenduke::oauth::OAuthClient > &  oauthClient,
const std::shared_ptr< const tenduke::jwt::JWTParser > &  jwtParser,
const std::shared_ptr< const tenduke::http::HTTPClient > &  httpClient 
)

Constructs new instance.

Parameters
oidcConfiguration-
oauthClient-
jwtParser-
httpClient-

Member Function Documentation

◆ ensureOpenIDScope()

std::string tenduke::oidc::BaseOIDCClient::ensureOpenIDScope ( const std::string &  scopes)
staticprotected

Checks if provided scopes have openid among them.

If not, adds it.

Parameters
scopes-
Returns
-

◆ refresh()

std::unique_ptr< const OIDCRefreshRequest > tenduke::oidc::BaseOIDCClient::refresh ( const std::shared_ptr< tenduke::oidc::OIDCState > &  state) const
overridevirtual

Refreshes the OIDC state.

Parameters
state-
Returns
-

Implements tenduke::oidc::OIDCClient.

◆ requestUserinfo()

std::string tenduke::oidc::BaseOIDCClient::requestUserinfo ( const std::string &  accessToken) const
overridevirtual

Requests user information from "userinfo"-endpoint.

(See https://openid.net/specs/openid-connect-core-1_0.html#UserInfo)

Note: Return type may change in the future.

Parameters
accessToken-
Returns
-
Exceptions
tenduke::http::HTTPResponseExceptionif HTTP-status codes indicate an error (e.g. 401, 404)
tenduke::http::HTTPExceptionif some HTTP-level error
tenduke::net:NetworkingExceptionif e.g. host not found, network connection issues etc.

Implements tenduke::oidc::OIDCClient.


The documentation for this class was generated from the following files: