|
10Duke Enterprise C++ SDK
|
Implementation of OpenID Connect protocol.
OpenID Connect (OIDC) is a lightweight layer over OAuth to authenticate (login) users. This namespace contains implementation of the OIDC and supporting logic for doing OIDC autodiscovery, analysis of ID-tokens and maintaining the login session in the client.
Namespaces | |
| namespace | device |
| OIDC-wrapping of OAuth Device Flow. | |
| namespace | osbrowser |
| Services to perform OIDC-login using OS-browser with loopback redirection. | |
Classes | |
| class | AutoDiscovery |
| Service for querying OIDC configuration from known URL. More... | |
| class | AutoDiscoveryResult |
| Result of OIDC auto-configuration query. More... | |
| class | BaseOIDCAuthenticationConfig |
| class | BaseOIDCClient |
| Base-class for OIDC-clients. More... | |
| class | BaseOIDCRequest |
| Base class for OIDC requests. More... | |
| class | DefaultOIDCBrowserFlow |
| Default implementation of browser-based OIDC-client. More... | |
| class | DefaultOIDCBrowserFlowAuthenticationRequest |
| Default browser-based OIDC authentication request. More... | |
| class | DefaultOIDCClientFactory |
| Default implementation of tenduke::oidc::OIDCClientFactory. More... | |
| class | DefaultOIDCRefreshRequest |
| Default implementation for tenduke::oidc::OIDCRefreshRequest. More... | |
| class | DefaultOIDCSessionEventListener |
| Default implementation of tenduke::oidc::OIDCSessionEventListener. More... | |
| class | IdToken |
| OIDC ID-token. More... | |
| class | IdTokenSession |
| A tenduke::oidc::OIDCSession, which uses ID-token as the source-of-truth for expiration times. More... | |
| class | IdTokenSessionRequestAuthenticator |
| A tenduke::http::HTTPRequestAuthenticator, which adds Authorization-header with OAuth ID-token. More... | |
| class | OIDCAuthenticationRequest |
| OIDC-request, which handles the OIDC-flow. More... | |
| class | OIDCAutoDiscoveryConfiguration |
| Configuration for OIDC auto-discovery. More... | |
| class | OIDCBrowserFlow |
| OpenID Connect -client. More... | |
| class | OIDCBrowserFlowAuthenticationRequest |
| An OIDC-authentication request, which handles the OIDC-flow, authenticating the user with browser. More... | |
| class | OIDCClient |
| OpenID Connect -client. More... | |
| class | OIDCClientFactory |
| Factory for creating tenduke::oidc::OIDCClient. More... | |
| class | OIDCConfiguration |
| OIDC-configuration. More... | |
| class | OIDCException |
| Thrown when OIDC-related errors occur. More... | |
| class | OIDCIdentityChanged |
| Thrown when the ID-token received on refresh does not have the same identity as the original ID-token (OIDC Core 12.2), or when the original state had no ID-token. More... | |
| class | OIDCLogin |
| High-level service to perform OIDC-login. More... | |
| class | OIDCLoginRequest |
| Login-request initiated by OIDCLogin-service. More... | |
| class | OIDCRefreshRequest |
| A request to refresh OIDC state. More... | |
| class | OIDCSession |
| Stateful service to manage OIDC-session. More... | |
| class | OIDCSessionConfiguration |
| Configuration for tenduke::oidc::OIDCSessionImpl. More... | |
| class | OIDCSessionEventListener |
| Event listener for OIDC session events. More... | |
| class | OIDCSessionImpl |
| Default implementation of tenduke::oidc::OIDCSession. More... | |
| class | OIDCSessionRequestAuthenticator |
| A tenduke::http::HTTPRequestAuthenticator, which adds Authorization-header with Bearer-token. More... | |
| class | OIDCState |
| Container of OIDC state, describing the user session. More... | |
| class | SerializedOIDCSession |
| A tenduke::oidc::OIDCSession, which guards that only one thread at a time can access the instance. More... | |
Functions | |
| std::string | stateToJson (const tenduke::oidc::OIDCState &state) |
| Converts the state to JSON. | |
| std::string | stateToJson (const std::shared_ptr< const tenduke::oidc::OIDCState > &state) |
| Converts the state to JSON. | |
| std::unique_ptr< tenduke::oidc::OIDCState > | stateFromJson (const std::string &stateAsJson, const tenduke::json::JSONParser &parser, const tenduke::jwt::JWTParser &jwtParser) |
| Parses JSON into tenduke::oidc::OIDCState. | |
Variables | |
| const std::string | CLAIM_NONCE = "nonce" |
| Claim name for nonce. | |
| const std::chrono::milliseconds | DEFAULT_SESSION_LOGIN_TIMEOUT = std::chrono::minutes(6) |
| Default login timeout. | |
| const std::chrono::seconds | DEFAULT_SESSION_CONCURRENCY_TIMEOUT = std::chrono::minutes(7) |
| Default timeout for serialized methods. | |
| std::unique_ptr< xdoidc::OIDCState > tenduke::oidc::stateFromJson | ( | const std::string & | stateAsJson, |
| const tenduke::json::JSONParser & | parser, | ||
| const tenduke::jwt::JWTParser & | jwtParser ) |
Parses JSON into tenduke::oidc::OIDCState.
A missing or null additionalProperties is read as no additional properties.
| stateAsJson | - |
| parser | - |
| jwtParser | - |
| tenduke::oidc::OIDCException | with error invalid_serialized_state if the state is malformed (the cause nested, if any), or with error no_id_token if it has no ID-token |
| tenduke::jwt::JWTValidationException | if the ID-token signature does not validate |
| std::string tenduke::oidc::stateToJson | ( | const std::shared_ptr< const tenduke::oidc::OIDCState > & | state | ) |
Converts the state to JSON.
The JSON contains the tokens in plain text, see stateToJson(const tenduke::oidc::OIDCState &).
| state | - |
| std::string tenduke::oidc::stateToJson | ( | const tenduke::oidc::OIDCState & | state | ) |
Converts the state to JSON.
The JSON contains the access token, the refresh token and the ID-token in plain text. It is a credential: store it in the operating system's credential store (or encrypted with a key stored there), never in a plain file or a log. See "Storing the session" in README.md.
| state | - |
| const std::chrono::seconds tenduke::oidc::DEFAULT_SESSION_CONCURRENCY_TIMEOUT = std::chrono::minutes(7) |
Default timeout for serialized methods.
Longer than the default login timeout of tenduke::oidc::OIDCSessionImpl (DEFAULT_SESSION_LOGIN_TIMEOUT, 6 minutes), so that a call waiting for an interactive login does not time out before the login does.