4#ifndef _Stroika_Frameworks_Auth_OAuth_Client_h_
5#define _Stroika_Frameworks_Auth_OAuth_Client_h_ 1
7#include "Stroika/Frameworks/StroikaPreComp.h"
9#include "Stroika/Foundation/Cache/TimedCache.h"
11#include "Stroika/Foundation/Common/Common.h"
12#include "Stroika/Foundation/Common/GUID.h"
13#include "Stroika/Foundation/Containers/KeyedCollection.h"
14#include "Stroika/Foundation/Containers/Mapping.h"
15#include "Stroika/Foundation/Containers/Sequence.h"
16#include "Stroika/Foundation/DataExchange/ObjectVariantMapper.h"
19#include "Stroika/Foundation/Execution/VirtualLockable.h"
30namespace Stroika::Frameworks::Auth::OAuth {
78 String grant_type{
"authorization_code"sv};
101 nonvirtual
String ToString ()
const;
105 nonvirtual
TypedBLOB ToWireFormat ()
const;
111#if qCompilerAndStdLib_explicitly_defaulted_threeway_warning_Buggy
112 DISABLE_COMPILER_CLANG_WARNING_START (
"clang diagnostic ignored \"-Wdefaulted-function-deleted\"")
118#if qCompilerAndStdLib_explicitly_defaulted_threeway_warning_Buggy
119 DISABLE_COMPILER_CLANG_WARNING_END (
"clang diagnostic ignored \"-Wdefaulted-function-deleted\"")
152 optional<String> id_token;
156 optional<String> token_type;
158 nonvirtual
String ToString ()
const;
160 nonvirtual
TypedBLOB ToWireFormat ()
const;
168 struct TokenRevocationRequest {
170 optional<String> refresh_token;
171 optional<String> client_id;
172 optional<String> client_secret;
174 nonvirtual
String ToString ()
const;
176 nonvirtual
TypedBLOB ToWireFormat ()
const;
193 nonvirtual
String ToString ()
const;
195 nonvirtual
TypedBLOB ToWireFormat ()
const;
207 optional<String> name;
211 optional<String> given_name;
215 optional<String> family_name;
219 optional<String> email;
224 optional<URI> picture;
226 nonvirtual
String ToString ()
const;
228 static UserInfo FromWireFormat (
const TypedBLOB& src);
241 bool fCaching{
false};
242 InternallySynchronized fInternallySyncrhonized{InternallySynchronized::eNotKnownInternallySynchronized};
292 nonvirtual
void RevokeTokens (
const TokenRevocationRequest& tr)
const;
321 nonvirtual optional<TokenIntrospectionResponse> FetchTokenIntrospectionQueitly_ (
const String& accessToken)
const;
325 const Options fOptions_;
333 unique_ptr<Cache_> fCache_;
Keep track of a bunch of objects, each with an associated time used to allow data to 'expire'.
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Set<T> is a container of T, where once an item is added, additionally adds () do nothing.
ObjectVariantMapper can be used to map C++ types to and from variant-union types, which can be transp...
TypedBLOB is a named tuple<Memory::BLOB, optional<InternetMediaType>> - with friendlier names,...
simple wrapper on IO::Network::Transfer to do fetching (more configurability to do)
nonvirtual UserInfo GetUserInfo(const String &accessToken) const
nonvirtual TokenResponse GetToken(const TokenRequest &tr) const
nonvirtual void RevokeTokens(const TokenRevocationRequest &tr) const
Track configuration data about stuff that differentiates different OAuth providers - what URLs to use...
InternallySynchronizedTraits same as argument traits, but resetting the kInternallySynchronized to eI...
take argument TRAITS, and set to track-expires-at mode.
RFC 7662 compatible API for finding info about a token - https://datatracker.ietf....
this is the argument to the Fetcher::GetToken () API. It typically consists of a client_id,...
optional< String > code_verifier
auto operator<=>(const TokenRequest &rhs) const =default
Compare by string value of various fields.
optional< String > refresh_token
optional< String > client_secret
optional< URI > redirect_uri
this is the response to the Fetcher::GetToken () API. It typically provides an 'access token' with a ...
optional< String > refresh_token