Support 3P oauth flow.

PiperOrigin-RevId: 663964316
This commit is contained in:
Suet-Fei Li
2024-08-16 19:39:13 -07:00
committed by Copybara-Service
parent f1a1c39177
commit a81ce57879
6 changed files with 51 additions and 7 deletions
@@ -55,7 +55,7 @@ class AccountManager {
// Gets current active account. If no login user, return std::nullopt.
virtual std::optional<Account> GetCurrentAccount() = 0;
// Initializes the login process for a Google account.
// Initializes the login process for a Google account from 1P client.
// |login_success_callback| is called when the login succeeded. Account
// information is passed to callback.
// |login_failure_callback| is called when the login fails.
@@ -63,6 +63,17 @@ class AccountManager {
absl::AnyInvocable<void(Account)> login_success_callback,
absl::AnyInvocable<void(absl::Status)> login_failure_callback) = 0;
// Initializes the login process for a Google account from an oauth client.
// |client_id| GCP client_id of the client
// |client_secret| GCP client_secret of the client
// |login_success_callback| is called when the login succeeded. Account
// information is passed to callback.
// |login_failure_callback| is called when the login fails.
virtual void Login(
absl::string_view client_id, absl::string_view client_secret,
absl::AnyInvocable<void(Account)> login_success_callback,
absl::AnyInvocable<void(absl::Status)> login_failure_callback) = 0;
// Logs out current active account. |logout_callback| is called when logout is
// completed.
virtual void Logout(