tree: 8e0150d1982303e11e8b4caa90496ea499fd474d [path history] [tgz]
  1. access_token_fetcher.cc
  2. access_token_fetcher.h
  3. access_token_fetcher_unittest.cc
  4. access_token_info.cc
  5. access_token_info.h
  6. account_info.typemap
  7. account_info_mojom_traits.cc
  8. account_info_mojom_traits.h
  9. account_state.cc
  10. account_state.h
  11. account_state.typemap
  12. account_state_mojom_traits.cc
  13. account_state_mojom_traits.h
  14. accounts_in_cookie_jar_info.cc
  15. accounts_in_cookie_jar_info.h
  16. accounts_mutator.h
  17. accounts_mutator_impl.cc
  18. accounts_mutator_impl.h
  19. accounts_mutator_unittest.cc
  20. BUILD.gn
  21. DEPS
  22. google_service_auth_error.typemap
  23. google_service_auth_error_mojom_traits.cc
  24. google_service_auth_error_mojom_traits.h
  25. identity_manager.cc
  26. identity_manager.h
  27. identity_manager_unittest.cc
  28. identity_test_environment.cc
  29. identity_test_environment.h
  30. identity_test_environment_unittest.cc
  31. identity_test_utils.cc
  32. identity_test_utils.h
  33. OWNERS
  34. primary_account_access_token_fetcher.cc
  35. primary_account_access_token_fetcher.h
  36. primary_account_access_token_fetcher_unittest.cc
  37. primary_account_mutator.h
  38. primary_account_mutator_impl.cc
  39. primary_account_mutator_impl.h
  40. primary_account_mutator_unittest.cc
  41. README.md
  42. scope_set.h
  43. scope_set.typemap
  44. scope_set_mojom_traits.h
  45. typemaps.gni
services/identity/public/cpp/README.md

IdentityManager is the next-generation C++ API for interacting with Google identity. It is currently backed by //components/signin (see IMPLEMENTATION NOTES below); in the long-term it will serve as the primary client-side interface to the Identity Service, encapsulating a connection to a remote implementation of identity::mojom::IdentityManager. It provides conveniences over the bare Identity Service Mojo interfaces such as:

  • Synchronous access to the information of the primary account (via caching)

Documentation on the mapping between usage of legacy signin classes (notably SigninManager(Base) and ProfileOAuth2TokenService) and usage of IdentityManager is available here:

https://docs.google.com/document/d/14f3qqkDM9IE4Ff_l6wuXvCMeHfSC9TxKezXTCyeaPUY/edit#

A quick inline cheat sheet for developers migrating from usage of //components/ signin and //google_apis/gaia:

  • “Primary account” in IdentityManager refers to what is called the “authenticated account” in SigninManager, i.e., the account that has been blessed for sync by the user.
  • PrimaryAccountTokenFetcher is the primary client-side interface for obtaining access tokens for the primary account. In particular, it can take care of waiting until the primary account is available.
  • AccessTokenFetcher is the client-side interface for obtaining access tokens for arbitrary accounts.
  • IdentityTestEnvironment is the preferred test infrastructure for unittests of production code that interacts with IdentityManager. It is suitable for use in cases where neither the production code nor the unittest is interacting with Profile (e.g., //components-level unittests).
  • identity_test_utils.h provides lower-level test facilities for interacting explicitly with IdentityManager and its dependencies (SigninManager, ProfileOAuth2TokenService). These facilities are the way to interact with IdentityManager in unittest contexts where the production code and/or the unittest are interacting with Profile (in particular, where the IdentityManager instance with which the test is interacting must be IdentityManagerFactory::GetForProfile(profile)).

IMPLEMENTATION NOTES

The Identity Service client library is being developed in parallel with the implementation and interfaces of the Identity Service itself. The motivation is to allow clients to be converted to use this client library in a parallel and pipelined fashion with building out the Identity Service as the backing implementation of the library.

In the near term, this library is backed directly by //components/signin classes. We are striving to make the interactions of this library with those classes as similar as possible to its eventual interaction with the Identity Service. In places where those interactions vary significantly from the envisioned eventual interaction with the Identity Service, we have placed TODOs.