10Duke Scale C++ Client
All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
OIDCState.h
1#ifndef TENDUKE_OIDC_OIDCSTATE_H
2#define TENDUKE_OIDC_OIDCSTATE_H
3
4#include "oidc/idtoken/IdToken.h"
5#include "oauth/OAuthStateImpl.h"
6
7#include <memory>
8#include <utility>
9
10namespace tenduke { namespace oidc {
11
17{
18public:
25 const tenduke::oauth::OAuthState &oauthState,
28 oauthState.getAccessToken(),
29 oauthState.getRefreshToken(),
30 oauthState.getExpiresAt(),
31 !oauthState.doesExpire(),
32 oauthState.getAdditionalProperties()
33 ), idToken(std::move(idToken))
34 {}
35
46 const std::string &accessToken,
47 const std::string &refreshToken,
48 const std::int64_t expiresAt,
49 bool infinite,
50 std::map<std::string, std::string> additionalProperties,
53 accessToken,
54 refreshToken,
55 expiresAt,
56 infinite,
57 std::move(additionalProperties)
58 ), idToken(std::move(idToken))
59 {}
60
61 // OIDC methods
62public:
64 const tenduke::oidc::IdToken &getIdToken() const {return idToken;}
65
66private:
67 const tenduke::oidc::IdToken idToken;
68};
69
70}}
71
72
73#endif //TENDUKE_OIDC_OIDCSTATE_H
Implementation of OAuthState.
Definition OAuthStateImpl.h:14
const std::map< std::string, std::string > & getAdditionalProperties() const override
Returns all additional properties returned by the server.
Definition OAuthStateImpl.h:65
const std::string & getRefreshToken() const override
Returns the refresh token.
Definition OAuthStateImpl.h:55
OAuthStateImpl(std::string accessToken, std::string refreshToken, int64_t expiresAt, bool infinite, std::map< std::string, std::string > additionalProperties)
Constructs new instance.
Definition OAuthStateImpl.h:24
bool doesExpire() const override
Returns true if the access token expires.
Definition OAuthStateImpl.h:93
std::int64_t getExpiresAt() const override
Returns timestamp (as epoch seconds) when the current access token expires.
Definition OAuthStateImpl.h:60
const std::string & getAccessToken() const override
Returns the access token.
Definition OAuthStateImpl.h:50
OAuth session state.
Definition OAuthState.h:17
OIDC ID-token.
Definition IdToken.h:15
Container of OIDC state, describing the user session.
Definition OIDCState.h:17
OIDCState(const std::string &accessToken, const std::string &refreshToken, const std::int64_t expiresAt, bool infinite, std::map< std::string, std::string > additionalProperties, tenduke::oidc::IdToken idToken)
Constructs new instance.
Definition OIDCState.h:45
OIDCState(const tenduke::oauth::OAuthState &oauthState, tenduke::oidc::IdToken idToken)
Constructs new instance.
Definition OIDCState.h:24
const tenduke::oidc::IdToken & getIdToken() const
Returns the contained ID-token.
Definition OIDCState.h:64
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7