RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
AcquireTokenInteractiveHandler.h
1 /*
2  * ======================================================================
3  * Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
4  * Licensed under the MIT License.
5  * See LICENSE.md in the project root for license information.
6  * ======================================================================
7 */
8 
9 #ifndef ACQUIRETOKENINTERACTIVEHANDLER_H
10 #define ACQUIRETOKENINTERACTIVEHANDLER_H
11 
12 #include "AcquireTokenHandlerBase.h"
13 #include "PromptBehavior.h"
14 #include "IWebUI.h"
15 #include "UserIdentifier.h"
16 #include "Exceptions.h"
17 #include "Constants.h"
18 #include "RmsauthIdHelper.h"
19 #include "AuthorizationResult.h"
20 #include "Url.h"
21 
22 namespace rmsauth {
23 
25 {
26  static const String& Tag() {static const String tag="AcquireTokenInteractiveHandler"; return tag;}
27 
28  AuthorizationResultPtr authorizationResult_ = nullptr;
29  String redirectUri_;
30  String redirectUriRequestParameter_;
31  PromptBehavior promptBehavior_;
32  String extraQueryParameters_;
33  IWebUIPtr webUi_ = nullptr;
34  UserIdentifierPtr userId_ = nullptr;
35 
36 public:
37  AcquireTokenInteractiveHandler(AuthenticatorPtr authenticator, TokenCachePtr tokenCache, const String& resource, const String& clientId, const String& redirectUri, PromptBehavior promptBehavior, UserIdentifierPtr userId, const String& extraQueryParameters, IWebUIPtr webUI, bool callSync);
38 
39 protected:
40  void addAditionalRequestParameters(RequestParameters& requestParameters) override;
41  void preTokenRequest() override;
42  void postTokenRequest(AuthenticationResultPtr result) override;
43  void acquireAuthorization();
44  void sendAuthorizeRequest();
45  static bool includeFormsAuthParams();
46  String createAuthorizationUriAsync(const Guid& correlationId);
47 
48 private:
49  String createAuthorizationUri(bool includeFormsAuthParam);
50  RequestParameters createAuthorizationRequest(const String& loginHint, bool includeFormsAuthParam);
51  void verifyAuthorizationResult();
52  static bool isDomainJoined();
53  static bool isUserLocal();
54  void setRedirectUriRequestParameter();
55  static void addHeadersToRequestParameters(RequestParameters& requestParameters, Headers headers);
56 };
57 
58 } // namespace rmsauth {
59 
60 #endif // ACQUIRETOKENINTERACTIVEHANDLER_H
Definition: RequestParameters.h:18
Definition: AcquireTokenHandlerBase.h:29
Definition: AcquireTokenInteractiveHandler.h:24
Definition: AcquireTokenForClientHandler.h:14
Definition: Guid.h:23