LeviLamina
Loading...
Searching...
No Matches
ActiveDirectoryIdentity.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/certificates/identity/LastClickedSource.h"
7#include "mc/certificates/identity/edu/Role.h"
8#include "mc/deps/code_builder/CodeBuilderPerformance.h"
9#include "mc/deps/core/minecraft/threading/EnableQueueForMainThread.h"
10#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
11#include "mc/deps/core/utility/NonOwnerPointer.h"
12#include "mc/deps/identity/edu_common/ActiveDirectoryAuthenticationState.h"
13#include "mc/options/EducationServicesEnvironment.h"
14#include "mc/platform/Result.h"
15
16// auto generated forward declare list
17// clang-format off
21class IEDUSystems;
23struct AccessTokenInfo;
24struct ServicePack;
25namespace Identity { class IEduAuth; }
26namespace Identity { class IEduSsoStrategy; }
27namespace Identity { struct ActiveDirectoryIdentityParameters; }
28namespace Identity { struct AuthError; }
29namespace Identity { struct AuthToken; }
30namespace Identity { struct EduAuthParameters; }
31namespace Identity { struct ServiceResponse; }
32namespace WebServices::EduSignin { struct SigninResponse; }
33namespace Identity { struct ISettingStorageStrategy; }
34namespace Identity { struct SignOutResult; }
35namespace edu::auth { struct CredentialsObserver; }
36// clang-format on
37
38class ActiveDirectoryIdentity : public ::Bedrock::EnableNonOwnerReferences,
40public:
41 // member variables
42 // NOLINTBEGIN
56 // NOLINTEND
57
58public:
59 // prevent constructor by default
60 ActiveDirectoryIdentity& operator=(ActiveDirectoryIdentity const&);
61 ActiveDirectoryIdentity(ActiveDirectoryIdentity const&);
62 ActiveDirectoryIdentity();
63
64public:
65 // virtual functions
66 // NOLINTBEGIN
67#ifdef LL_PLAT_S
68 virtual ~ActiveDirectoryIdentity() /*override*/ = default;
69#else // LL_PLAT_C
70 virtual ~ActiveDirectoryIdentity() /*override*/;
71#endif
72
73 // NOLINTEND
74
75public:
76 // member functions
77 // NOLINTBEGIN
78#ifdef LL_PLAT_C
79 MCNAPI ActiveDirectoryIdentity(
80 ::Bedrock::NotNullNonOwnerPtr<::IEDUSystems> eduSystems,
82 );
83
84 MCNAPI ActiveDirectoryIdentity(
86 ::std::optional<::EducationServicesEnvironment> environment,
87 ::std::unique_ptr<::IActiveDirectoryIdentityTelemetry>&& eventing,
88 ::std::unique_ptr<::Identity::ISettingStorageStrategy>&& settings,
89 ::std::unique_ptr<::Identity::IEduSsoStrategy>&& sso,
90 ::std::function<::std::unique_ptr<::Identity::IEduAuth>(::Identity::EduAuthParameters&&)> createAuth,
91 ::std::unique_ptr<::ResponseVerifier> verifier,
92 ::std::string appSessionId
93 );
94
95 MCNAPI void _authenticateDemoWithService();
96
97 MCNAPI void _authenticateSignInWithService();
98
99 MCNAPI void _handleAuthenticationResponse(::WebServices::EduSignin::SigninResponse& response);
100
101 MCNAPI void _identityGained();
102
103 MCNAPI void _identityLost();
104
105 MCNAPI void _onError(
106 ::std::string const& error,
107 ::ActiveDirectoryAuthenticationState newState,
108 ::std::vector<::std::pair<::std::string, ::std::string>> details
109 );
110
111 MCNAPI void _onStatusChanged(::ActiveDirectoryAuthenticationState from, ::ActiveDirectoryAuthenticationState to);
112
113 MCNAPI ::AccessTokenInfo _parseTokenInfo(::std::string const& tokenToParse) const;
114
115 MCNAPI void _populateResponse(::WebServices::EduSignin::SigninResponse const& response);
116
117 MCNAPI void _signInCanceled();
118
119 MCNAPI void _updateData(
121 bool isRefresh
122 );
123
124 MCNAPI void _updateGraphData(
126 bool isRefresh
127 );
128
129 MCNAPI void addObserver(::edu::auth::CredentialsObserver& observer);
130
131 MCNAPI void fireCodeBuilderLoadPerformanceEvent(::CodeBuilderPerformance::Stage stage) const;
132
133 MCNAPI void fireEventADPopupEvent(::ADPopupTelemetryEvent const& popupEvent) const;
134
135 MCNAPI ::std::string const& getAADIdentityToken() const;
136
137 MCNAPI ::ActiveDirectoryAuthenticationState getAuthenticationState() const;
138
139 MCNAPI void getDemo();
140
141 MCNAPI ::std::shared_ptr<::Identity::IEduAuth> getEduAuth() const;
142
143 MCNAPI ::std::string const& getEmail() const;
144
145 MCNAPI ::std::optional<::Identity::AuthToken> getGraphToken() const;
146
147 MCNAPI void getIdentity();
148
149 MCNAPI ::std::string const& getName() const;
150
151 MCNAPI ::std::string const& getNickname() const;
152
153 MCNAPI ::std::string const& getOid() const;
154
155 MCNAPI ::std::optional<::ActiveDirectoryPopup> const getPopup() const;
156
157 MCNAPI ::edu::Role getRole() const;
158
159 MCNAPI ::std::string const& getTenantId() const;
160
161 MCNAPI ::std::string const& getTenantType() const;
162
163 MCNAPI void initialPackRequest(::std::function<void(::std::vector<::ServicePack>)> packReturnCallback);
164
165 MCNAPI bool isDemo() const;
166
167 MCNAPI void resetAuthenticationState();
168
169 MCNAPI void setAuthenticationStateComplete();
170
171 MCNAPI void setAuthenticationStateDemo();
172
173 MCNAPI void setAuthenticationStateOfferPurchase();
174
175 MCNAPI void setEulaAccepted();
176
177 MCNAPI void setLastClickedSource(::LastClickedSource buttonName);
178
179 MCNAPI void setPurchaseReceipt(::std::string const& receipt, ::std::function<void(bool)> const& callback);
180
181 MCNAPI void signOut(::std::function<void(::Identity::SignOutResult)> callback) const;
182
183 MCNAPI void tick();
184#endif
185 // NOLINTEND
186
187public:
188 // static functions
189 // NOLINTBEGIN
190#ifdef LL_PLAT_C
191 MCNAPI static ::std::string const getPublicKeysEndpoint();
192
193 MCNAPI static ::std::string const& getServiceEndpoint();
194#endif
195 // NOLINTEND
196
197public:
198 // static variables
199 // NOLINTBEGIN
200 MCNAPI static ::std::string const& IS_VALID_FIELD();
201
202 MCNAPI static ::std::string const& JWT_EXPIRATION_FIELD();
203
204 MCNAPI static ::std::string const& JWT_REQUEST_ID_FIELD();
205
206 MCNAPI static ::std::string const& PAYLOAD_FIELD();
207
208 MCNAPI static ::std::string const& PUBLIC_KEY();
209
210 MCNAPI static ::std::string const& REQUEST_ID_FIELD();
211
212 MCNAPI static ::std::string const& RESPONSE_FIELD();
213
214 MCNAPI static ::std::string& mCachedServiceEndpoint();
215 // NOLINTEND
216
217public:
218 // constructor thunks
219 // NOLINTBEGIN
220#ifdef LL_PLAT_C
221 MCNAPI void* $ctor(
222 ::Bedrock::NotNullNonOwnerPtr<::IEDUSystems> eduSystems,
224 );
225
226 MCNAPI void* $ctor(
228 ::std::optional<::EducationServicesEnvironment> environment,
229 ::std::unique_ptr<::IActiveDirectoryIdentityTelemetry>&& eventing,
230 ::std::unique_ptr<::Identity::ISettingStorageStrategy>&& settings,
231 ::std::unique_ptr<::Identity::IEduSsoStrategy>&& sso,
232 ::std::function<::std::unique_ptr<::Identity::IEduAuth>(::Identity::EduAuthParameters&&)> createAuth,
233 ::std::unique_ptr<::ResponseVerifier> verifier,
234 ::std::string appSessionId
235 );
236#endif
237 // NOLINTEND
238
239public:
240 // destructor thunk
241 // NOLINTBEGIN
242 MCNAPI void $dtor();
243 // NOLINTEND
244
245public:
246 // vftables
247 // NOLINTBEGIN
249
251 // NOLINTEND
252};
Definition ADPopupTelemetryEvent.h:13
static MCAPI ::std::string const & REQUEST_ID_FIELD()
static MCAPI ::std::string const & RESPONSE_FIELD()
static MCAPI ::std::string const & JWT_EXPIRATION_FIELD()
static MCAPI ::std::string const & JWT_REQUEST_ID_FIELD()
static MCAPI ::std::string const & PAYLOAD_FIELD()
static MCAPI ::std::string const & IS_VALID_FIELD()
static MCAPI ::std::string const & PUBLIC_KEY()
static MCAPI ::std::string & mCachedServiceEndpoint()
static MCAPI void ** $vftableForEnableQueueForMainThread()
static MCAPI void ** $vftableForEnableNonOwnerReferences()
Definition ActiveDirectoryPopup.h:18
Definition EnableNonOwnerReferences.h:7
Definition NonOwnerPointer.h:9
Definition Result.h:9
Definition EnableQueueForMainThread.h:11
Definition IActiveDirectoryIdentityTelemetry.h:11
Definition IEDUSystems.h:14
Definition IEduAuth.h:21
Definition IEduSsoStrategy.h:22
Definition ResponseVerifier.h:10
Definition AccessTokenInfo.h:5
Definition ActiveDirectoryIdentityParameters.h:7
Definition AuthError.h:7
Definition AuthToken.h:7
Definition EduAuthParameters.h:7
Definition ISettingStorageStrategy.h:7
Definition ServiceResponse.h:7
Definition SignOutResult.h:7
Definition ServicePack.h:13
Definition SigninResponse.h:7
Definition CredentialsObserver.h:7
Definition Alias.h:14