|
10Duke Enterprise C++ SDK
|
#include <DefaultOIDCRefreshRequest.h>
Default implementation for tenduke::oidc::OIDCRefreshRequest.
Public Member Functions | |
| DefaultOIDCRefreshRequest (const std::shared_ptr< const tenduke::oidc::OIDCState > &originalState, std::unique_ptr< const tenduke::oauth::OAuthRefreshRequest > request, const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const std::string &clientId, const std::shared_ptr< const tenduke::jwt::JWTParser > &parseJWT, const std::shared_ptr< tenduke::time::Clock > &clock) | |
| Constructs new instance. | |
| std::unique_ptr< tenduke::oidc::OIDCState > | execute () const override |
| Exectutes the request. | |
| Public Member Functions inherited from tenduke::oidc::BaseOIDCRequest | |
| BaseOIDCRequest (const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > &oidcConfiguration, std::string clientId, const std::shared_ptr< const tenduke::jwt::JWTParser > &jwtParser, const std::shared_ptr< tenduke::time::Clock > &clock, std::string nonce) | |
| Constructs new instance. | |
Protected Member Functions | |
| virtual void | validateSameIdentity (const tenduke::oidc::IdToken &original, const tenduke::oidc::IdToken &refreshed) const |
| Validates that the ID-token from the refresh response has the same identity as the original ID-token, as required by OIDC Core 12.2: "iss", "sub", "aud" and "azp" must be the same, and "auth_time" and "nonce" must be the same if present in the new ID-token. | |
| Protected Member Functions inherited from tenduke::oidc::BaseOIDCRequest | |
| virtual std::unique_ptr< tenduke::oidc::OIDCState > | toOIDCState (tenduke::oauth::OAuthState &oauthState) const |
| Creates OIDCState from OAuthState. | |
| virtual tenduke::oidc::IdToken | parseIdToken (const std::string &serializedIdToken, const std::string &expectedNonce) const |
| Parses id token. | |
| virtual void | validateAudience (const tenduke::oidc::IdToken &idToken) const |
| Validates ID-token "aud" and "azp" claims against the client id. | |
| virtual void | validateTimes (const tenduke::oidc::IdToken &idToken) const |
| Validates ID-token time claims "exp" (required), "nbf" and "iat" against current time, allowing clock skew of OIDCConfiguration::allowedClockSkewS. | |
Additional Inherited Members | |
| Static Protected Member Functions inherited from tenduke::oidc::BaseOIDCRequest | |
| static std::vector< std::string > | getAudiences (const tenduke::oidc::IdToken &idToken) |
| Returns the ID-token audiences: "aud" can be a single string or an array of strings. | |
| Protected Attributes inherited from tenduke::oidc::BaseOIDCRequest | |
| const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > | oidcConfiguration |
| OIDC-configuration. | |
| const std::string | clientId |
| OAuth client id of this client, expected in ID-token "aud" (and "azp") claim. | |
| const std::shared_ptr< const tenduke::jwt::JWTParser > | parseJWT |
| JWT parser. | |
| const std::shared_ptr< tenduke::time::Clock > | clock |
| Clock for validating ID-token time claims. | |
| tenduke::oidc::DefaultOIDCRefreshRequest::DefaultOIDCRefreshRequest | ( | const std::shared_ptr< const tenduke::oidc::OIDCState > & | originalState, |
| std::unique_ptr< const tenduke::oauth::OAuthRefreshRequest > | request, | ||
| const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > & | oidcConfiguration, | ||
| const std::string & | clientId, | ||
| const std::shared_ptr< const tenduke::jwt::JWTParser > & | parseJWT, | ||
| const std::shared_ptr< tenduke::time::Clock > & | clock ) |
Constructs new instance.
| originalState | - |
| request | - |
| oidcConfiguration | - |
| clientId | OAuth client id of this client |
| parseJWT | - |
| clock | clock for validating ID-token time claims |
|
overridevirtual |
Exectutes the request.
Implements tenduke::oidc::OIDCRefreshRequest.
|
protectedvirtual |
Validates that the ID-token from the refresh response has the same identity as the original ID-token, as required by OIDC Core 12.2: "iss", "sub", "aud" and "azp" must be the same, and "auth_time" and "nonce" must be the same if present in the new ID-token.
If the original state has no ID-token, the new ID-token is rejected, because the identity would change.
| original | ID-token of the original state |
| refreshed | ID-token from the refresh response |
| tenduke::oidc::OIDCIdentityChanged | if the identity does not match |