Commit b5cbafdb authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Remove CWVAuthenticationController in prepration for new class that

will combine signin and sync for //ios/web_view.

//ios/web_view only needs to signin because it needs to sync autofill
data. As such, we will combine them to simplify the API.

Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I9ecefad6523ae0207ec5c33516fd90bc536633b1
Reviewed-on: https://chromium-review.googlesource.com/1089352Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565083}
parent 3e343ca4
......@@ -19,7 +19,7 @@ buildflag_header("web_view_features") {
header = "cwv_web_view_features.h"
flags = [
"IOS_WEB_VIEW_ENABLE_SIGNIN=$ios_web_view_enable_signin",
"IOS_WEB_VIEW_ENABLE_SYNC=$ios_web_view_enable_sync",
"IOS_WEB_VIEW_ENABLE_AUTOFILL=$ios_web_view_enable_autofill",
]
}
......@@ -64,13 +64,8 @@ ios_web_view_public_headers = [
"public/cwv_web_view.h",
"public/cwv_web_view_configuration.h",
]
if (ios_web_view_enable_signin) {
ios_web_view_public_headers += [
"public/cwv_authentication_controller.h",
"public/cwv_authentication_controller_delegate.h",
"public/cwv_identity.h",
"public/cwv_web_view_configuration_signin.h",
]
if (ios_web_view_enable_sync) {
ios_web_view_public_headers += [ "public/cwv_identity.h" ]
}
if (ios_web_view_enable_autofill) {
ios_web_view_public_headers += [
......@@ -186,12 +181,8 @@ ios_web_view_sources = [
"internal/webdata_services/web_view_web_data_service_wrapper_factory.h",
]
ios_web_view_sources += ios_web_view_public_headers
if (ios_web_view_enable_signin) {
ios_web_view_sources += [
"internal/signin/cwv_authentication_controller.mm",
"internal/signin/cwv_authentication_controller_internal.h",
"internal/signin/cwv_identity.mm",
]
if (ios_web_view_enable_sync) {
ios_web_view_sources += [ "internal/signin/cwv_identity.mm" ]
}
if (ios_web_view_enable_autofill) {
ios_web_view_sources += [
......
......@@ -6,8 +6,8 @@ declare_args() {
# Controls if cronet is included.
ios_web_view_include_cronet = true
# Controls if signin APIs are exposed.
ios_web_view_enable_signin = true
# Controls if sync APIs are exposed.
ios_web_view_enable_sync = true
# Controls if autofill APIs are exposed.
ios_web_view_enable_autofill = true
......
......@@ -69,9 +69,9 @@ PrefService* ApplicationContext::GetLocalState() {
scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple);
flags_ui::PrefServiceFlagsStorage::RegisterPrefs(pref_registry.get());
PrefProxyConfigTrackerImpl::RegisterPrefs(pref_registry.get());
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
SigninManagerBase::RegisterPrefs(pref_registry.get());
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
base::FilePath local_state_path;
base::PathService::Get(base::DIR_APP_DATA, &local_state_path);
......
......@@ -15,7 +15,6 @@
#import "ios/web_view/internal/cwv_preferences_internal.h"
#import "ios/web_view/internal/cwv_user_content_controller_internal.h"
#import "ios/web_view/internal/cwv_web_view_internal.h"
#import "ios/web_view/internal/signin/cwv_authentication_controller_internal.h"
#include "ios/web_view/internal/web_view_browser_state.h"
#include "ios/web_view/internal/web_view_global_state_util.h"
......@@ -34,13 +33,6 @@
BOOL _wasShutDown;
}
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
// This web view configuration's authentication controller.
// nil if CWVWebViewConfiguration is created with +incognitoConfiguration.
@property(nonatomic, readonly, nullable)
CWVAuthenticationController* authenticationController;
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_AUTOFILL)
// This web view configuration's autofill data manager.
// nil if CWVWebViewConfiguration is created with +incognitoConfiguration.
......@@ -56,9 +48,6 @@
@implementation CWVWebViewConfiguration
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
@synthesize authenticationController = _authenticationController;
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_AUTOFILL)
@synthesize autofillDataManager = _autofillDataManager;
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_AUTOFILL)
......@@ -127,18 +116,6 @@ CWVWebViewConfiguration* gIncognitoConfiguration = nil;
DCHECK(_wasShutDown);
}
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#pragma mark - Signin
- (CWVAuthenticationController*)authenticationController {
if (!_authenticationController && self.persistent) {
_authenticationController = [[CWVAuthenticationController alloc]
initWithBrowserState:self.browserState];
}
return _authenticationController;
}
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_AUTOFILL)
#pragma mark - Autofill
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/web_view/internal/signin/cwv_authentication_controller_internal.h"
#include "base/strings/sys_string_conversions.h"
#include "components/signin/core/browser/account_info.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/ios/browser/profile_oauth2_token_service_ios_delegate.h"
#include "ios/web_view/internal/signin/ios_web_view_signin_client.h"
#include "ios/web_view/internal/signin/web_view_account_tracker_service_factory.h"
#include "ios/web_view/internal/signin/web_view_oauth2_token_service_factory.h"
#include "ios/web_view/internal/signin/web_view_signin_client_factory.h"
#include "ios/web_view/internal/signin/web_view_signin_manager_factory.h"
#include "ios/web_view/internal/web_view_browser_state.h"
#import "ios/web_view/public/cwv_authentication_controller_delegate.h"
#import "ios/web_view/public/cwv_identity.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@implementation CWVAuthenticationController {
ios_web_view::WebViewBrowserState* _browserState;
}
@synthesize delegate = _delegate;
- (instancetype)initWithBrowserState:
(ios_web_view::WebViewBrowserState*)browserState {
self = [super init];
if (self) {
_browserState = browserState;
ios_web_view::WebViewSigninClientFactory::GetForBrowserState(_browserState)
->SetAuthenticationController(self);
}
return self;
}
- (void)dealloc {
ios_web_view::WebViewSigninClientFactory::GetForBrowserState(_browserState)
->SetAuthenticationController(nil);
}
#pragma mark - Public Methods
- (void)setDelegate:(id<CWVAuthenticationControllerDelegate>)delegate {
_delegate = delegate;
std::string authenticatedAccountID = [self authenticatedAccountID];
if (!authenticatedAccountID.empty()) {
[self tokenService]->LoadCredentials(authenticatedAccountID);
}
}
- (CWVIdentity*)currentIdentity {
AccountInfo accountInfo =
[self accountInfoForAccountID:[self authenticatedAccountID]];
if (!accountInfo.IsValid()) {
return nil;
}
NSString* email = base::SysUTF8ToNSString(accountInfo.email);
NSString* fullName = base::SysUTF8ToNSString(accountInfo.full_name);
NSString* gaiaID = base::SysUTF8ToNSString(accountInfo.gaia);
return
[[CWVIdentity alloc] initWithEmail:email fullName:fullName gaiaID:gaiaID];
}
- (void)signInWithIdentity:(CWVIdentity*)identity {
AccountTrackerService* accountTracker =
ios_web_view::WebViewAccountTrackerServiceFactory::GetForBrowserState(
_browserState);
AccountInfo info;
info.gaia = base::SysNSStringToUTF8(identity.gaiaID);
info.email = base::SysNSStringToUTF8(identity.email);
info.full_name = base::SysNSStringToUTF8(identity.fullName);
std::string newAuthenticatedAccountID = accountTracker->SeedAccountInfo(info);
std::string oldAuthenticatedAccountID = [self authenticatedAccountID];
ios_web_view::WebViewSigninManagerFactory::GetForBrowserState(_browserState)
->GetAuthenticatedAccountId();
// Assert if already signed in as a different user.
if (!oldAuthenticatedAccountID.empty())
CHECK_EQ(newAuthenticatedAccountID, oldAuthenticatedAccountID);
std::string newAuthenticatedEmail =
[self accountInfoForAccountID:newAuthenticatedAccountID].email;
ios_web_view::WebViewSigninManagerFactory::GetForBrowserState(_browserState)
->OnExternalSigninCompleted(newAuthenticatedEmail);
[self tokenServiceDelegate]->ReloadCredentials(newAuthenticatedAccountID);
}
- (void)signOut {
ios_web_view::WebViewSigninManagerFactory::GetForBrowserState(_browserState)
->SignOut(signin_metrics::ProfileSignout::USER_CLICKED_SIGNOUT_SETTINGS,
signin_metrics::SignoutDelete::IGNORE_METRIC);
}
#pragma mark - Private Methods
- (ProfileOAuth2TokenService*)tokenService {
return ios_web_view::WebViewOAuth2TokenServiceFactory::GetForBrowserState(
_browserState);
}
- (ProfileOAuth2TokenServiceIOSDelegate*)tokenServiceDelegate {
return static_cast<ProfileOAuth2TokenServiceIOSDelegate*>(
[self tokenService]->GetDelegate());
}
- (std::string)authenticatedAccountID {
return ios_web_view::WebViewSigninManagerFactory::GetForBrowserState(
_browserState)
->GetAuthenticatedAccountId();
}
- (AccountInfo)accountInfoForAccountID:(const std::string&)accountID {
AccountTrackerService* accountTracker =
ios_web_view::WebViewAccountTrackerServiceFactory::GetForBrowserState(
_browserState);
return accountTracker->GetAccountInfo(accountID);
}
@end
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_VIEW_INTERNAL_SIGNIN_CWV_AUTHENTICATION_CONTROLLER_INTERNAL_H_
#define IOS_WEB_VIEW_INTERNAL_SIGNIN_CWV_AUTHENTICATION_CONTROLLER_INTERNAL_H_
#import "ios/web_view/public/cwv_authentication_controller.h"
NS_ASSUME_NONNULL_BEGIN
namespace ios_web_view {
class WebViewBrowserState;
} // namespace ios_web_view
@interface CWVAuthenticationController ()
// |browserState| must outlive this class.
- (instancetype)initWithBrowserState:
(ios_web_view::WebViewBrowserState*)browserState NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_INTERNAL_SIGNIN_CWV_AUTHENTICATION_CONTROLLER_INTERNAL_H_
......@@ -17,8 +17,6 @@
#include "net/url_request/url_request_context_getter.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
@class CWVAuthenticationController;
// iOS WebView specific signin client.
class IOSWebViewSigninClient : public SigninClient,
public SigninErrorController::Observer {
......@@ -67,11 +65,6 @@ class IOSWebViewSigninClient : public SigninClient,
// SigninErrorController::Observer implementation.
void OnErrorChanged() override;
// Setter and getter for |authentication_controller_|.
void SetAuthenticationController(
CWVAuthenticationController* authentication_controller);
CWVAuthenticationController* GetAuthenticationController();
private:
// SigninClient private implementation.
void OnSignedOut() override;
......@@ -92,9 +85,6 @@ class IOSWebViewSigninClient : public SigninClient,
// The TokenWebData associated with this service.
scoped_refptr<TokenWebData> token_web_data_;
// The CWVAuthenticationController associated with this service.
__weak CWVAuthenticationController* authentication_controller_;
DISALLOW_COPY_AND_ASSIGN(IOSWebViewSigninClient);
};
......
......@@ -125,14 +125,3 @@ std::unique_ptr<GaiaAuthFetcher> IOSWebViewSigninClient::CreateGaiaAuthFetcher(
}
void IOSWebViewSigninClient::OnErrorChanged() {}
void IOSWebViewSigninClient::SetAuthenticationController(
CWVAuthenticationController* authentication_controller) {
DCHECK(!authentication_controller || !authentication_controller_);
authentication_controller_ = authentication_controller;
}
CWVAuthenticationController*
IOSWebViewSigninClient::GetAuthenticationController() {
return authentication_controller_;
}
......@@ -56,8 +56,7 @@ WebViewOAuth2TokenServiceFactory::BuildServiceInstanceFor(
IOSWebViewSigninClient* signin_client =
WebViewSigninClientFactory::GetForBrowserState(browser_state);
auto token_service_provider =
std::make_unique<WebViewProfileOAuth2TokenServiceIOSProviderImpl>(
signin_client);
std::make_unique<WebViewProfileOAuth2TokenServiceIOSProviderImpl>();
auto delegate = std::make_unique<ProfileOAuth2TokenServiceIOSDelegate>(
signin_client, std::move(token_service_provider),
WebViewAccountTrackerServiceFactory::GetForBrowserState(browser_state),
......
......@@ -11,14 +11,11 @@
#include "base/macros.h"
#include "components/signin/ios/browser/profile_oauth2_token_service_ios_provider.h"
class IOSWebViewSigninClient;
// Implementation of ProfileOAuth2TokenServiceIOSProvider.
class WebViewProfileOAuth2TokenServiceIOSProviderImpl
: public ProfileOAuth2TokenServiceIOSProvider {
public:
WebViewProfileOAuth2TokenServiceIOSProviderImpl(
IOSWebViewSigninClient* signin_client);
WebViewProfileOAuth2TokenServiceIOSProviderImpl();
~WebViewProfileOAuth2TokenServiceIOSProviderImpl() override;
// ios::ProfileOAuth2TokenServiceIOSProvider
......@@ -32,8 +29,6 @@ class WebViewProfileOAuth2TokenServiceIOSProviderImpl
NSError* error) const override;
private:
IOSWebViewSigninClient* signin_client_;
DISALLOW_COPY_AND_ASSIGN(WebViewProfileOAuth2TokenServiceIOSProviderImpl);
};
......
......@@ -6,9 +6,7 @@
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/web_view/internal/signin/cwv_authentication_controller_internal.h"
#include "ios/web_view/internal/signin/ios_web_view_signin_client.h"
#import "ios/web_view/public/cwv_authentication_controller_delegate.h"
#import "ios/web_view/public/cwv_identity.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
......@@ -16,9 +14,7 @@
#endif
WebViewProfileOAuth2TokenServiceIOSProviderImpl::
WebViewProfileOAuth2TokenServiceIOSProviderImpl(
IOSWebViewSigninClient* signin_client)
: signin_client_(signin_client) {}
WebViewProfileOAuth2TokenServiceIOSProviderImpl() {}
WebViewProfileOAuth2TokenServiceIOSProviderImpl::
~WebViewProfileOAuth2TokenServiceIOSProviderImpl() = default;
......@@ -28,55 +24,11 @@ void WebViewProfileOAuth2TokenServiceIOSProviderImpl::GetAccessToken(
const std::string& client_id,
const std::set<std::string>& scopes,
const AccessTokenCallback& callback) {
CWVAuthenticationController* authentication_controller =
signin_client_->GetAuthenticationController();
id<CWVAuthenticationControllerDelegate> delegate =
authentication_controller.delegate;
if (!delegate) {
// TODO(crbug.com/780937): Invoke callback with proper error.
return;
}
AccessTokenCallback scoped_callback = callback;
NSString* ns_gaia_id = base::SysUTF8ToNSString(gaia_id);
NSString* ns_client_id = base::SysUTF8ToNSString(client_id);
NSMutableArray* scopes_array = [[NSMutableArray alloc] init];
for (const auto& scope : scopes) {
[scopes_array addObject:base::SysUTF8ToNSString(scope)];
}
void (^token_callback)(NSString*, NSDate*, NSError*) =
^void(NSString* token, NSDate* expiration, NSError* error) {
if (!scoped_callback.is_null()) {
scoped_callback.Run(token, expiration, error);
}
};
[delegate authenticationController:authentication_controller
getAccessTokenForGaiaID:ns_gaia_id
clientID:ns_client_id
scopes:scopes_array
completionHandler:token_callback];
}
std::vector<ProfileOAuth2TokenServiceIOSProvider::AccountInfo>
WebViewProfileOAuth2TokenServiceIOSProviderImpl::GetAllAccounts() const {
CWVAuthenticationController* authentication_controller =
signin_client_->GetAuthenticationController();
id<CWVAuthenticationControllerDelegate> delegate =
authentication_controller.delegate;
if (!delegate) {
return {};
}
NSArray<CWVIdentity*>* identities = [delegate
allIdentitiesForAuthenticationController:authentication_controller];
std::vector<ProfileOAuth2TokenServiceIOSProvider::AccountInfo> accounts;
for (CWVIdentity* identity in identities) {
ProfileOAuth2TokenServiceIOSProvider::AccountInfo account;
account.email = base::SysNSStringToUTF8(identity.email);
account.gaia = base::SysNSStringToUTF8(identity.gaiaID);
accounts.push_back(account);
}
return accounts;
return {};
}
AuthenticationErrorCategory
......
......@@ -96,9 +96,9 @@ WebViewBrowserState::WebViewBrowserState(
base::ThreadRestrictions::SetIOAllowed(wasIOAllowed);
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
ActiveStateManager::FromBrowserState(this)->SetActive(true);
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
BrowserStateDependencyManager::GetInstance()->CreateBrowserStateServices(
this);
......@@ -108,9 +108,9 @@ WebViewBrowserState::~WebViewBrowserState() {
BrowserStateDependencyManager::GetInstance()->DestroyBrowserStateServices(
this);
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
ActiveStateManager::FromBrowserState(this)->SetActive(false);
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
}
PrefService* WebViewBrowserState::GetPrefs() {
......@@ -171,7 +171,7 @@ void WebViewBrowserState::RegisterPrefs(
WebViewWebDataServiceWrapperFactory::GetInstance();
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_AUTOFILL)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
WebViewCookieSettingsFactory::GetInstance();
WebViewHostContentSettingsMapFactory::GetInstance();
WebViewAccountFetcherServiceFactory::GetInstance();
......@@ -182,7 +182,7 @@ void WebViewBrowserState::RegisterPrefs(
WebViewSigninErrorControllerFactory::GetInstance();
WebViewSigninManagerFactory::GetInstance();
WebViewIdentityManagerFactory::GetInstance();
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
BrowserStateDependencyManager::GetInstance()
->RegisterBrowserStatePrefsForServices(this, pref_registry);
......
......@@ -43,10 +43,10 @@ void WebViewWebMainParts::PreCreateThreads() {
void WebViewWebMainParts::PreMainMessageLoopRun() {
WebViewTranslateService::GetInstance()->Initialize();
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#if BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
ContentSettingsPattern::SetNonWildcardDomainNonPortSchemes(
/*schemes=*/nullptr, 0);
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SIGNIN)
#endif // BUILDFLAG(IOS_WEB_VIEW_ENABLE_SYNC)
}
void WebViewWebMainParts::PostMainMessageLoopRun() {
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_VIEW_PUBLIC_CWV_AUTHENTICATION_CONTROLLER_H_
#define IOS_WEB_VIEW_PUBLIC_CWV_AUTHENTICATION_CONTROLLER_H_
#import <Foundation/Foundation.h>
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
@protocol CWVAuthenticationControllerDelegate;
@class CWVIdentity;
// Controller used to manage authentication.
CWV_EXPORT
@interface CWVAuthenticationController : NSObject
// Delegate used to provide account information.
@property(nonatomic, weak, nullable) id<CWVAuthenticationControllerDelegate>
delegate;
// The signed in user, if any.
@property(nonatomic, readonly, nullable) CWVIdentity* currentIdentity;
- (instancetype)init NS_UNAVAILABLE;
// Logs in with |identity| into ChromeWebView.
// Causes an assertion failure if |currentIdentity| is non-nil and
// different from |identity|.
- (void)signInWithIdentity:(CWVIdentity*)identity;
// Logs out |currentIdentity|.
- (void)signOut;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_AUTHENTICATION_CONTROLLER_H_
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_VIEW_PUBLIC_CWV_AUTHENTICATION_CONTROLLER_DELEGATE_H_
#define IOS_WEB_VIEW_PUBLIC_CWV_AUTHENTICATION_CONTROLLER_DELEGATE_H_
#import <Foundation/Foundation.h>
#import "cwv_export.h"
NS_ASSUME_NONNULL_BEGIN
// |accessToken| OAuth2 access token.
// |expirationDate| Expiration date of |accessToken|.
// |error| Error object to provide if |accessToken| was unable to fetched.
typedef void (^TokenCompletionHandler)(NSString* _Nullable accessToken,
NSDate* _Nullable expirationDate,
NSError* _Nullable error);
@class CWVAuthenticationController;
CWV_EXPORT
@protocol CWVAuthenticationControllerDelegate<NSObject>
// Called when ChromeWebView needs an access token.
// See go/ios-sso-library for documentation on the following parameters.
// |gaiaID| The GaiaID of the user whose access token is requested.
// |clientID| The clientID of ChromeWebView. Used to verify it is the same as
// the one passed to CWVWebView and SSO.
// |scopes| The OAuth scopes requested.
// |completionHandler| Used to return access tokens, expiration date, and error.
- (void)authenticationController:(CWVAuthenticationController*)controller
getAccessTokenForGaiaID:(NSString*)gaiaID
clientID:(NSString*)clientID
scopes:(NSArray<NSString*>*)scopes
completionHandler:(TokenCompletionHandler)completionHandler;
// Called when ChromeWebView needs a list of all SSO identities.
// Every identity returned here may be reflected in google web properties.
// This will not be called unless signed in.
// Must at least contain signed in user.
- (NSArray<CWVIdentity*>*)allIdentitiesForAuthenticationController:
(CWVAuthenticationController*)controller;
@end
NS_ASSUME_NONNULL_END
#endif // IOS_WEB_VIEW_PUBLIC_CWV_AUTHENTICATION_CONTROLLER_DELEGATE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment