New issue
Advanced search Search tips

Issue 889902 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Task


Sign in to add a comment

☂ Provide IdentityManager APIs to manage signin

Project Member Reported by sdefresne@chromium.org, Sep 27

Issue description

Signing-in is a multi step process and there are many related methods. The methods involved are:
- SigninManager::StartSignInWithRefreshToken()
- SigninManager::CopyCredentialsFrom()
- SigninManager::MergeSigninCredentialInCookieJar()
- SigninManager::CompletePendingSignin()
- SigninManager::OnExternalSigninCompleted()
- SigninManager::AuthInProgress()
- SigninManager::GetAccountIdForAuthInProgress()
- SigninManager::GetGaiaIdForAuthInProgress()
- SigninManager::GetUsernameForAuthInProgress()

Given the number of methods, and the fact that they are not available on one platform (ChromeOS), it may be worth moving them to a separate object (name to be decided, name in progress IdentityMutator). It is probably worth moving the methods related to signing out to that object too, i.e. IdentityManager::SignOut().

 
Blocking: 890768
Blocking: 890780
Blocking: 890787
Blocking: 890789
Blocking: 890793
Blocking: 890796
Blocking: 890797
Blocking: 890801
Blocking: 890802
Blocking: 890811
Blocking: 890818
Blocking: 890813
@sdefresne: Are you planning to work on this one yourself anytime soon? Seems to be blocking quite a few other tasks, and I was wondering whether it would make sense for me to work on this one, or if you'd rather do it yourself (and the lack of a Proj-Servicification-VendorBug tag makes me think of the later).


I am currently working on a design for refactoring those APIs. I understand that this is blocking many migration bugs, and thus it is one of my highest priority bug.
Owner: sdefresne@chromium.org
Status: Started (was: Available)
> I am currently working on a design for refactoring those APIs. I understand that this is blocking many migration bugs, and thus it is one of my highest priority bug.

Thanks @sdefresne for the heads-up. Looking forward to the new APIs!
The plan is detailed in the following doc: https://docs.google.com/document/d/1YVx-SW0VbrAnek69PVxQ1ie71VewcuKvf8JvIzFfuRQ/edit?ts=5bbf5648#heading=h.ipadtjj8bkuv

TL;DR: a new PrimaryAccountMutator interface will be developed. That new class will expose all methods to mutate the primary account. An instance will be available via IdentityManager::GetPrimaryAccountMutator(). That method may return null (on Chrome OS) so the return value need to be DCHECK-ed. This will remove the need for casting from SigninManagerBase* to SigninManager*.

I will now work on adding this interface.
Blocking: 896698
Project Member

Comment 20 by bugdroid1@chromium.org, Oct 24

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

commit 079b419e93080e7088aab44deec145de7461fe93
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Wed Oct 24 21:42:25 2018

Introduce PrimaryAccountMutator.

PrimaryAccountMutator is a new API that wraps the method related to the
mutation of the signed-in state of the primary account. It will become
the recommended API to set and clear the primary account when migrating
to the Identity Service API.

The PrimaryAccountMutatorImpl methods are not implemented yet. They
will be implemented in follow up CLs (and corresponding tests added).
This is done to limit the size of the CLs.

Design document is available at:
https://docs.google.com/document/d/1YVx-SW0VbrAnek69PVxQ1ie71VewcuKvf8JvIzFfuRQ/view

Bug: 889902
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I2acd1ebdccadfebb855e55f4e9b78c148557ed85
Reviewed-on: https://chromium-review.googlesource.com/c/1286852
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602467}
[modify] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/chrome/browser/signin/identity_manager_factory.cc
[modify] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/ios/chrome/browser/signin/identity_manager_factory.cc
[modify] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/ios/web_view/internal/signin/web_view_identity_manager_factory.mm
[modify] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/services/identity/public/cpp/BUILD.gn
[modify] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/services/identity/public/cpp/identity_manager.cc
[modify] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/services/identity/public/cpp/identity_manager.h
[modify] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/services/identity/public/cpp/identity_manager_unittest.cc
[modify] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/services/identity/public/cpp/identity_test_environment.cc
[add] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/services/identity/public/cpp/primary_account_mutator.h
[add] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/services/identity/public/cpp/primary_account_mutator_impl.cc
[add] https://crrev.com/079b419e93080e7088aab44deec145de7461fe93/services/identity/public/cpp/primary_account_mutator_impl.h

@sdefresne sorry to insist a bit on this issue, but I was wondering if you might have any update on the implementation of the PrimaryAccountMutator, since I'm reaching a point where I could use implementations for whatever will map to SigninManager::MergeSigninCredentialInCookieJar() and SigninManager::AuthInProgress().

Thanks!
Blocking: 890817
Blocking: 890819
Blocking: 890820
Blocking: 890821
Blocking: 903838
Blocking: 903875
Blocking: 903892
Blocking: 882464
Sorry, I was out of the office since Nov 1st and just came back. I'll work on adding implementation for the method as soon as possible.
Project Member

Comment 31 by bugdroid1@chromium.org, Nov 15

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

commit 582d3964d03bdd1ab54f5ce02adc6adfb7053b9e
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Thu Nov 15 16:22:27 2018

Add implementation for PrimaryAccountMutatorImpl [1/N]

Add implementation and test for PrimaryAccountMutatorImpl
methods {Set,Is}SettingPrimaryAccountAllowed.

Bug: 889902,  806778 
Change-Id: Ibd75f2b3a988b4c403eab3b682a157e31e4b2e18
Reviewed-on: https://chromium-review.googlesource.com/c/1335937
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608390}
[modify] https://crrev.com/582d3964d03bdd1ab54f5ce02adc6adfb7053b9e/components/signin/core/browser/signin_manager.cc
[modify] https://crrev.com/582d3964d03bdd1ab54f5ce02adc6adfb7053b9e/components/signin/core/browser/signin_manager.h
[modify] https://crrev.com/582d3964d03bdd1ab54f5ce02adc6adfb7053b9e/components/signin/core/browser/signin_manager_base.h
[modify] https://crrev.com/582d3964d03bdd1ab54f5ce02adc6adfb7053b9e/services/identity/BUILD.gn
[modify] https://crrev.com/582d3964d03bdd1ab54f5ce02adc6adfb7053b9e/services/identity/public/cpp/BUILD.gn
[modify] https://crrev.com/582d3964d03bdd1ab54f5ce02adc6adfb7053b9e/services/identity/public/cpp/primary_account_mutator_impl.cc
[add] https://crrev.com/582d3964d03bdd1ab54f5ce02adc6adfb7053b9e/services/identity/public/cpp/primary_account_mutator_unittest.cc

Project Member

Comment 32 by bugdroid1@chromium.org, Nov 16

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

commit 7b32e1d79f6e38b8824c3cd47f768632680251ce
Author: Sylvain Defresne <sdefresne@chromium.org>
Date: Fri Nov 16 12:03:51 2018

Add implementation for PrimaryAccountMutatorImpl [2/N]

Add implementation and test for PrimaryAccountMutatorImpl
method SetPrimaryAccount. The method is the new API that
will replace SigninManager::OnExternalSigninCompleted().

Bug: 889902,  806778 
Change-Id: I0ece2927c24506644a1087a7ed10df4578d592e3
Reviewed-on: https://chromium-review.googlesource.com/c/1335601
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608735}
[modify] https://crrev.com/7b32e1d79f6e38b8824c3cd47f768632680251ce/services/identity/public/cpp/primary_account_mutator.h
[modify] https://crrev.com/7b32e1d79f6e38b8824c3cd47f768632680251ce/services/identity/public/cpp/primary_account_mutator_impl.cc
[modify] https://crrev.com/7b32e1d79f6e38b8824c3cd47f768632680251ce/services/identity/public/cpp/primary_account_mutator_unittest.cc

Blockedon: 906056
Blockedon: 906058
Blockedon: 906059
Blockedon: 906060
Blockedon: 906062
Blockedon: 906064
Blockedon: 906065
Blocking: -890802

Sign in to add a comment