|
10Duke Enterprise C++ SDK
|
#include <DeserializeStateFromJSON.h>
Service for deserializing client state from JSON.
Used when bootstrapping the client.
The state is read from a file or other storage, which the application or the user can modify. The ID-token of the OIDC-session is verified: the signature, the issuer and the audience. Its expiry is not checked, because a stored ID-token has typically expired, and the session refreshes it. If the ID-token does not verify, the OIDC-session is dropped, and the user has to log in again.
Public Member Functions | |
| DeserializeStateFromJSON (const std::shared_ptr< const ::tenduke::jwt::JWTParserFactory > &newJWTParser, const std::shared_ptr< const ::tenduke::json::JSONParser > &parseJSON, const std::shared_ptr<::tenduke::jwt::JWTSignatureValidator > &signatureValidator, std::string expectedIssuer, std::string clientId) | |
| Constructs new instance. | |
| ::tenduke::ee::ClientState | from (const std::string &stateSerializedAsJSON) const |
| Deserializes the state from JSON. | |
Protected Member Functions | |
| ::tenduke::ee::ClientState | parseState (const ::tenduke::json::JSONObject *document) const |
| Parses the state from JSON object. | |
| ::std::shared_ptr<::tenduke::oidc::OIDCState > | deserializeOIDCState (const ::tenduke::json::JSONObject *oidcSession) const |
| Parses OIDC-state from the state. | |
| tenduke::ee::DeserializeStateFromJSON::DeserializeStateFromJSON | ( | const std::shared_ptr< const ::tenduke::jwt::JWTParserFactory > & | newJWTParser, |
| const std::shared_ptr< const ::tenduke::json::JSONParser > & | parseJSON, | ||
| const std::shared_ptr<::tenduke::jwt::JWTSignatureValidator > & | signatureValidator, | ||
| std::string | expectedIssuer, | ||
| std::string | clientId ) |
Constructs new instance.
| newJWTParser | - |
| parseJSON | - |
| signatureValidator | validates the signature of the ID-token, e.g. tenduke::oidc::OIDCConfiguration::signatureValidator |
| expectedIssuer | expected issuer of the ID-token, e.g. tenduke::oidc::OIDCConfiguration::issuer |
| clientId | OAuth client id of this client. The ID-token audience must contain it. |
| std::invalid_argument | if the signature validator is null |
|
protected |
Parses OIDC-state from the state.
| oidcSession | - |
| ClientState tenduke::ee::DeserializeStateFromJSON::from | ( | const std::string & | stateSerializedAsJSON | ) | const |
Deserializes the state from JSON.
Returns empty state, if the JSON does not parse or is not an object. Returns state without OIDC-session, if the ID-token of the session does not verify.
| stateSerializedAsJSON | - |
|
protected |
Parses the state from JSON object.
| document | - |