New issue
Advanced search Search tips

Issue 729554 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Dec 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 729556

Blocking:
issue 683120
issue 731060
issue 731086



Sign in to add a comment

Identity Service: Determine how to migrate clients away from obtaining signin info synchronously

Project Member Reported by blundell@chromium.org, Jun 5 2017

Issue description

Currently clients commonly call at least two synchronous methods::

- SigninManagerBase::GetAuthenticatedAccountId()
- ProfileOAuth2TokenService::RefreshTokenIsAvailable()

It seems that there's a common pattern of a client getting the primary account ID, determining whether there's a refresh token available for that ID, and observing PO2TS for a refresh token being available if not.

However, this synchronous communication won't be available with the Identity Service. Hence, we need to determine how to migrate clients away from relying on it.

My current thinking is that we can have an interface that returns the AccountInfo for the authenticated account *once* it has a refresh token available. We'll then have to carefully migrate clients away from relying on having this information synchronously to being able to handle getting it only asynchronously. The latter analysis will necessarily happen on a case-by-case basis, but some recipes will likely emerge. Note that if a client is subsequently obtaining access tokens from PO2TS, then there is already asynchronicity in its flow, so it shouldn't be too challenging to incorporate the obtaining of the signin info itself into that asynchronous flow.
 
Labels: IdentityService
Blocking: 683120
Blockedon: 729556
Blocking: 731060
Blocking: 731086
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d

commit 57fb65023bddfdfcaf42478b35e9ec17e6f9c53d
Author: Colin Blundell <blundell@chromium.org>
Date: Tue Jun 27 13:39:25 2017

Add concept of "state of account" to Identity Service and example usage

Clients of signin code have a common use case of getting an AccountInfo
(e.g., for the primary account) followed by getting information about
the state of that account (e.g., whether it has a refresh token
available). This CL facilitates porting this use case to the Identity
Service by:

- Adding an AccountState Mojo interface. AccountState represents the
  current state of the account (as opposed to AccountInfo, which
  represents long-lived information about the account such as the
  Account ID).
- Having the methods that return an AccountInfo return an AccountState
  as well.

Note that AccountState currently only carries the information of
whether the account has a refresh token available, but we anticipate
adding other information over time (e.g., the last auth error that
was encountered for this account).

This CL also ports the implementation of the
chrome.identity.getAuthToken() function to use the new functionality
instead of directly calling
OAuth2TokenService::RefreshTokenIsAvailable() after receiving the
account ID.

Bug:  729554 ,  729556 
Change-Id: I9a1c3ecb6d9be491850e7ab99388515a34705eef
Reviewed-on: https://chromium-review.googlesource.com/538672
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482613}
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.h
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/identity_manager.cc
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/identity_manager.h
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/identity_manager_unittest.cc
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/cpp/BUILD.gn
[add] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/cpp/account_state.cc
[add] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/cpp/account_state.h
[add] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/cpp/account_state.typemap
[add] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/cpp/account_state_struct_traits.cc
[add] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/cpp/account_state_struct_traits.h
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/cpp/typemaps.gni
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/interfaces/BUILD.gn
[add] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/interfaces/account_state.mojom
[modify] https://crrev.com/57fb65023bddfdfcaf42478b35e9ec17e6f9c53d/services/identity/public/interfaces/identity_manager.mojom

Components: Services>SignIn
Components: Internals>Services>Identity
Project Member

Comment 9 by sheriffbot@chromium.org, Nov 6

--Chrome Identity automated triaging--

This bug is Available and has gone one year without any activity. If another month passes without any activity, this bug will be closed out. Please provide an update with the latest status for this bug. Please see https://goo.gl/78kbny for more details. Please remove the Services>SignIn or UI>Browser>Profiles components if this bug isn't related to Chrome Identity.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 10 by sheriffbot@chromium.org, Dec 6

Cc: droger@chromium.org jlebel@chromium.org bsazonov@chromium.org ew...@chromium.org tangltom@chromium.org sabineb@chromium.org msarda@chromium.org
Status: Archived (was: Available)
--Chrome Identity automated triaging--

This available, signin or profiles-related bug has gone at least 30 days since the last automated post without any further update. This bug will be closed out due to inactivity. Please re-open the bug and provide an update if it is still a valid or reproducible bug. Please see https://goo.gl/78kbny for more details. Please remove the Services>SignIn or UI>Browser>Profiles components if this bug isn't related to Chrome Identity.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment