summaryrefslogtreecommitdiff
path: root/chromium/components/arc/common/auth.mojom
blob: 4bd67303924d678c65aad8616e4983fbc2d34540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2015 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.

module arc;

// These values describe failure reason of sign-in.
enum ArcSignInFailureReason {
  UNKNOWN_ERROR = 0,
  NETWORK_ERROR = 1,
  SERVICE_UNAVAILABLE = 2,
  BAD_AUTHENTICATION = 3,
  GMS_CORE_NOT_AVAILABLE = 4,
  CLOUD_PROVISION_FLOW_FAIL = 5,
};

interface AuthHost {
  // Returns an authorization code, which can be used to sign in.
  GetAuthCodeDeprecated@0() => (string auth_code);
  // Returns an authorization code in case is_enforced is set, which can be used
  // to sign in.
  [MinVersion=1] GetAuthCode@1() => (string auth_code, bool is_enforced);
  // Gets whether the account is managed from Chrome OS.
  [MinVersion=3] GetIsAccountManaged@4() => (bool is_managed);
  // Notifies Chrome that the sign-in is completed successfully.
  [MinVersion=2] OnSignInComplete@2();
  // Notifies Chrome that the sign-in fails to complete and provides failure
  // reason.
  [MinVersion=2] OnSignInFailed@3(ArcSignInFailureReason reason);
};

interface AuthInstance {
  // Establishes full-duplex communication with the host.
  Init(AuthHost host_ptr);
};