9 #ifndef ACQUIRETOKENHANDLERBASE_H
10 #define ACQUIRETOKENHANDLERBASE_H
13 #include "Authenticator.h"
14 #include "ClientKey.h"
15 #include "TokenCache.h"
16 #include "TokenSubjectType.h"
17 #include "Exceptions.h"
18 #include "AuthenticationResult.h"
19 #include "RequestParameters.h"
21 #include "OAuthConstants.h"
22 #include "Constants.h"
23 #include "TokenSubjectType.h"
24 #include "HttpHelper.h"
25 #include "UserIdentifier.h"
31 static const String& Tag() {
static const String tag=
"AcquireTokenHandlerBase";
return tag;}
34 AuthenticatorPtr authenticator_ =
nullptr;
35 TokenCachePtr tokenCache_ =
nullptr;
37 ClientKeyPtr clientKey_ =
nullptr;
38 TokenSubjectType tokenSubjectType_;
42 CallStatePtr callState_ =
nullptr;
44 UserIdentifierType userIdentifierType_;
47 String displayableId_;
50 AuthenticationResultPtr runAsync();
51 static CallStatePtr createCallState(
const Guid& correlationId,
bool callSync);
54 AcquireTokenHandlerBase(AuthenticatorPtr authenticator, TokenCachePtr tokenCache,
const String& resource, ClientKeyPtr clientKey, TokenSubjectType subjectType,
bool callSync);
55 virtual void preRunAsync();
56 virtual void postRunAsync(AuthenticationResultPtr result);
57 virtual void preTokenRequest();
58 virtual void postTokenRequest(AuthenticationResultPtr result);
59 virtual void addAditionalRequestParameters(
RequestParameters& requestParameters) = 0;
60 virtual AuthenticationResultPtr sendTokenRequestAsync();
61 AuthenticationResultPtr sendTokenRequestByRefreshTokenAsync(
const String& refreshToken);
64 AuthenticationResultPtr refreshAccessTokenAsync(AuthenticationResultPtr result);
65 AuthenticationResultPtr sendHttpMessageAsync(
const RequestParameters& requestParameters);
66 void notifyBeforeAccessCache();
67 void notifyAfterAccessCache();
68 void logReturnedToken(AuthenticationResultPtr result);
69 void validateAuthorityType();
74 #endif // ACQUIRETOKENHANDLERBASE_H
Definition: RequestParameters.h:18
Definition: AcquireTokenHandlerBase.h:29
Definition: AcquireTokenForClientHandler.h:14