מדריך לשילוב EMM

מדריך זה עוזר לספקים של ניהול ניידות ארגונית לשלב הרשמה דרך הארגון במסוף שלהם. אפשר להמשיך לקרוא כדי לקבל מידע נוסף על הרשמה ולקרוא עצות לשיטות מומלצות שיעזרו לכם להקצות מכשירים לבקר DPC (בקר מדיניות המכשיר). אם יש לכם בקר DPC, תוכלו ללמוד שיטות מומלצות בנוגע להקצאת מכשירים ולקבל עצות לפיתוח ולבדיקה.

תכונות לאדמינים ב-IT

אפשר להשתמש ב-Customer API כדי לעזור לאדמינים ב-IT להגדיר הרשמה דרך הארגון ישירות מהמסוף. הנה כמה משימות שאדמין IT עשוי לבצע במסוף שלך:

  • אפשר ליצור, לערוך ולמחוק הגדרות של הרשמה דרך הארגון, על סמך המדיניות לנייד.
  • הגדירו את ברירת המחדל כדי שבקר ה-DPC יקצה מכשירים עתידיים שהארגון ירכוש.
  • אפשר להחיל הגדרות ספציפיות על מכשירים או להסיר מכשירים מההרשמה דרך הארגון.

למידע נוסף על הרשמה דרך הארגון, כדאי לקרוא את הסקירה הכללית.

דרישות מוקדמות

לפני שמוסיפים הרשמה דרך הארגון למסוף ה-EMM, צריך לוודא שהפתרון תומך בתכונות הבאות:

  • פתרון ה-EMM שלכם צריך להקצות מכשיר Android 8.0+ (Pixel 7.1+ ) בבעלות החברה במצב מנוהל. אפשר להקצות מכשירי Android 10+ בבעלות החברה כמנוהלים באופן מלא או באמצעות פרופיל עבודה.
  • מכיוון שהרשמה דרך הארגון מורידה ומתקיןה באופן אוטומטי בקר DPC, ה-DPC חייב להיות זמין מ-Google Play. יש לנו רשימה של בקרי DPC תואמים שמנהלי IT יכולים להגדיר באמצעות ממשק ה-API של הלקוח או הפורטל. כדי להוסיף את ה-DPC לרשימה, צריך לשלוח בקשה לשינוי מוצר דרך קהילת ספקי ה-EMM.
  • הלקוחות שלך צריכים חשבון הרשמה דרך הארגון כדי לקרוא ל-API של הלקוח. מפיץ שותף מגדיר את החשבון לארגון של אדמין ב-IT כשהארגון קונה את המכשירים שלו.
  • המכשיר צריך להיות תואם ל-Google Mobile Services (GMS), ו-Google Play Services צריכה להיות מופעלת כל הזמן כדי שההרשמה דרך הארגון תפעל באופן תקין.

קריאה ל-API

משתמשי המסוף (באמצעות חשבון Google שלהם) מאשרים את בקשות ה-API שלכם ל-API של הלקוח. התהליך הזה שונה מההרשאה שמבצעים לממשקי API אחרים של EMM. במאמר הרשאה מוסבר איך לעשות זאת באפליקציה.

התנאים וההגבלות של הכינוי

המשתמשים צריכים לאשר את התנאים וההגבלות העדכניים לפני הקריאה ל-API. אם הקריאה ל-API מחזירה קוד סטטוס HTTP 403 Forbidden וגוף התגובה מכיל TosError, עליכם לבקש מהמשתמש לאשר את התנאים וההגבלות באמצעות כניסה לפורטל ההרשמה דרך הארגון. הדוגמה הבאה מראה את אחת מהדרכים לעשות זאת:

Java

// Authorize this method call as a user that hasn't yet accepted the ToS.
final String googleApiFormatHttpHeader = "X-GOOG-API-FORMAT-VERSION";
final String googleApiFormatVersion = "2";
final String tosErrorType =
      "type.googleapis.com/google.android.device.provisioning.v1.TosError";

try {
  // Send an API request to list all the DPCs available including the HTTP header
  // X-GOOG-API-FORMAT-VERSION with the value 2. Import the  exception:
  // from googleapiclient.errors import HttpError
  AndroidProvisioningPartner.Customers.Dpcs.List request =
        service.customers().dpcs().list(customerAccount);
  request.getRequestHeaders().put(googleApiFormatHttpHeader, googleApiFormatVersion);
  CustomerListDpcsResponse response = request.execute();
  return response.getDpcs();

} catch (GoogleJsonResponseException e) {
  // Get the error details. In your app, check details exists first.
  ArrayList<Map> details = (ArrayList<Map>) e.getDetails().get("details");
  for (Map detail : details) {
    if (detail.get("@type").equals(tosErrorType)
          && (boolean) detail.get("latestTosAccepted") != true) {
      // Ask the user to accept the ToS. If they agree, open the portal in a browser.
      // ...
    }
  }
  return null;
}

‎.NET

// Authorize this method call as a user that hasn't yet accepted the ToS.
try
{
    var request = service.Customers.Dpcs.List(customerAccount);
    CustomerListDpcsResponse response = request.Execute();
    return response.Dpcs;
}
catch (GoogleApiException e)
{
    foreach (SingleError error in e.Error?.Errors)
    {
        if (error.Message.StartsWith("The user must agree the terms of service"))
        {
            // Ask the user to accept the ToS. If they agree, open the portal in a browser.
            // ...
        }
    }
}

Python

# Authorize this method call as a user that hasn't yet accepted the ToS.
tos_error_type = ('type.googleapis.com/'
                  'google.android.device.provisioning.v1.TosError')
portal_url = 'https://partner.android.com/zerotouch'

# Send an API request to list all the DPCs available including the HTTP
# header X-GOOG-API-FORMAT-VERSION with the value 2. Import the exception:
# from googleapiclient.errors import HttpError
try:
  request = service.customers().dpcs().list(parent=customer_account)
  request.headers['X-GOOG-API-FORMAT-VERSION'] = '2'
  response = request.execute()
  return response['dpcs']

except HttpError as err:
  # Parse the JSON content of the error. In your app, check ToS exists first.
  error = json.loads(err.content)
  tos_error = error['error']['details'][0]

  # Ask the user to accept the ToS (not shown here). If they agree, then open
  # the portal in a browser.
  if (tos_error['@type'] == tos_error_type
      and tos_error['latestTosAccepted'] is not True):
    if raw_input('Accept the ToS in the zero-touch portal? y|n ') == 'y':
      webbrowser.open(portal_url)

אם לקוח Google API שלכם תומך בשגיאות מפורטות (בקשות Java, Python או HTTP), עליכם לכלול את כותרת ה-HTTP X-GOOG-API-FORMAT-VERSION עם הערך 2 בבקשות. אם הלקוח שלכם לא תומך בשגיאות מפורטות (NET. ואחרים), צריך להתאים את הודעת השגיאה.

אם נעדכן את התנאים וההגבלות בעתיד, אם תפעלו בהתאם, האפליקציה תכוון את המשתמשים לאשר מחדש את התנאים וההגבלות החדשים.

אדמינים ב-IT משתמשים בפורטל ההרשמה דרך הארגון כדי לנהל את המשתמשים בארגון שלהם – לא ניתן להציע את זה דרך ה-API של הלקוח. אדמינים ב-IT יכולים גם לנהל מכשירים והגדרות באמצעות הפורטל. אם אתם צריכים לקשר לפורטל מהמסוף או בתיעוד שלכם, השתמשו בכתובת ה-URL הבאה:

https://partner.android.com/zerotouch

כדאי להודיע לאדמינים ב-IT שהם מתבקשים להיכנס באמצעות חשבון Google שלהם.

צירוף מכשיר לתוכנית

הרשמה דרך הארגון היא מנגנון לרישום מכשירים, והיא דומה להרשמה ב-NFC או הרשמה באמצעות קוד QR. המסוף צריך לתמוך במכשירים מנוהלים, וה-DPC צריך להיות מסוגל לפעול במצב מכשיר מנוהל.

הרשמה דרך הארגון זמינה במכשירים נתמכים עם Android מגרסה 8.0 ואילך. אדמינים ב-IT צריכים לרכוש מכשירים נתמכים ממפיץ שותף. מתקשרים אל customers.devices.list כדי לעקוב אחר המכשירים של מנהל ה-IT שזמינים להרשמה דרך הארגון.

פירטנו כאן איך פועלת ההרשמה:

  1. המכשיר בודק את ההרשמה דרך שרת Google באמצעות שרת של Google בהפעלה הראשונה (או אחרי איפוס להגדרות המקוריות).
  2. אם מנהל ה-IT החיל הגדרה על המכשיר, ההרשמה דרך הארגון תפעיל את אשף ההגדרה של Android המנוהל במלואו, ותתאים אישית את המסכים על סמך המטא-נתונים מהתצורה.
  3. הרשמה דרך הארגון מורידה ומתקין את ה-DPC מ-Google Play.
  4. בקר ה-DPC מקבל את הכוונה ACTION_PROVISION_MANAGED_DEVICE ומקצה את המכשיר.

אם אין חיבור לאינטרנט, הבדיקה מתבצעת כשיהיה חיבור זמין. למידע נוסף על הקצאת מכשירים באמצעות הרשמה דרך הארגון, ראו הקצאת הרשאות בהמשך.

הגדרות ברירת מחדל

'הרשמה דרך הארגון' עוזרת לאדמינים ב-IT כשהם מגדירים הגדרות ברירת מחדל, שתחול על כל המכשירים החדשים שהארגון ירכוש. אם לא נקבעה הגדרות ברירת מחדל, אפשר לקדם אותן. אפשר לבדוק את הערך של customers.configurations.isDefault כדי לברר אם הארגון קבע הגדרות ברירת מחדל.

הדוגמה הבאה מראה איך אפשר להפוך מערך הגדרות אישיות קיים לברירת המחדל:

Java

// Send minimal data with the request. Just the 2 required fields.
// targetConfiguration is an existing configuration that we want to make the default.
Configuration configuration = new Configuration();
configuration.setIsDefault(true);
configuration.setConfigurationId(targetConfiguration.getConfigurationId());

// Call the API, including the FieldMask to avoid setting other fields to null.
AndroidProvisioningPartner.Customers.Configurations.Patch request = service
      .customers()
      .configurations()
      .patch(targetConfiguration.getName(), configuration);
request.setUpdateMask("isDefault");
Configuration results = request.execute();

‎.NET

// Send minimal data with the request. Just the 2 required fields.
// targetConfiguration is an existing configuration that we want to make the default.
Configuration configuration = new Configuration
{
    IsDefault = true,
    ConfigurationId = targetConfiguration.ConfigurationId,
};

// Call the API, including the FieldMask to avoid setting other fields to null.
var request = service.Customers.Configurations.Patch(configuration,
                                                     targetConfiguration.Name);
request.UpdateMask = "IsDefault";
Configuration results = request.Execute();

Python

# Send minimal data with the request. Just the 2 required fields.
# target_configuration is an existing configuration we'll make the default.
configuration = {
    'isDefault': True,
    'configurationId': target_configuration['configurationId']}

# Call the API, including the FieldMask to avoid setting other fields to null.
response = service.customers().configurations().patch(
    name=target_configuration['name'],
    body=configuration, updateMask='isDefault').execute()

הפניה לבקר DPC

מומלץ להשתמש בשם של משאב ה-API customers.dpcs.name כדי לזהות את ה-DPC ולהשתמש בו בהגדרות. שם המשאב מכיל מזהה ייחודי ולא משתנה של ה-DPC. מתקשרים אל customers.dpcs.list כדי לקבל רשימה של כל מחשבי ה-DPC הנתמכים. בגלל ששם המשאב כולל גם את מספר הלקוח, עליכם לסנן את הרשימה באמצעות רכיב הנתיב האחרון כדי למצוא מופע תואם של Dpc. הדוגמה הבאה מראה איך להתאים את ה-DPC ולהשתמש בו מאוחר יותר בהגדרות:

Java

// Return a customer Dpc instance for the specified DPC ID.
String myDpcIdentifier = "AH6Gbe4aiS459wlz58L30cqbbXbUa_JR9...xMSWCiYiuHRWeBbu86Yjq";
final int dpcIdIndex = 3;
final String dpcComponentSeparator = "/";
// ...
for (Dpc dpcApp : dpcs) {
    // Because the DPC name is in the format customers/{CUST_ID}/dpcs/{DPC_ID}, check the
    // fourth component matches the DPC ID.
    String dpcId = dpcApp.getName().split(dpcComponentSeparator)[dpcIdIndex];
    if (dpcId.equals(myDpcIdentifier)) {
        System.out.format("My DPC is: %s\n", dpcApp.getDpcName());
        return dpcApp;
    }
}
// Handle the case when the DPC isn't found...

‎.NET

// Return a customer Dpc instance for the specified DPC ID.
var myDpcIdentifer = "AH6Gbe4aiS459wlz58L30cqbbXbUa_JR9...fE9WdHcxMSWCiYiuHRWeBbu86Yjq";
const int dpcIdIndex = 3;
const String dpcComponentSeparator = "/";
// ...
foreach (Dpc dpcApp in dpcs)
{
    // Because the DPC name is in the format customers/{CUST_ID}/dpcs/{DPC_ID}, check the
    // fourth component matches the DPC ID.
    String dpcId = dpcApp.Name.Split(dpcComponentSeparator)[dpcIdIndex];
    if (dpcId.Equals(myDpcIdentifer))
    {
        Console.WriteLine("Matched DPC is: {0}", dpcApp.DpcName);
        return dpcApp;
    }
}
// Handle the case when the DPC isn't found...

Python

# Return a customer Dpc instance for the specified DPC ID.
my_dpc_id = 'AH6Gbe4aiS459wlz58L30cqb...fE9WdHcxMSWCiYiuHRWeBbu86Yjq'
# ...
for dpc_app in dpcs:
  # Because the DPC name is in the format customers/{CUST_ID}/dpcs/{DPC_ID},
  # check the fourth component matches the DPC ID.
  dpc_id = dpc_app['name'].split('/')[3]
  if dpc_id == my_dpc_id:
    return dpc_app

# Handle the case when the DPC isn't found...

אם אתם צריכים להציג את השם של ה-DPC בממשק המשתמש של המסוף, עליכם להציג את הערך שהוחזר מ-customers.dpcs.dpcName.

הקצאה

נצל את ההזדמנות כדי לספק חוויית משתמש מעולה להקצאת המכשיר. שם משתמש וסיסמה הם כל מה שנדרש כדי לנהל את התצורה של המכשיר. חשוב לזכור, מפיצים עשויים לשלוח מכשירים ישירות למשתמשים מרוחקים. כדאי לכלול את כל ההגדרות האחרות, כמו שרת EMM או יחידה ארגונית, ב-customers.configuration.dpcExtras.

קטע הקוד של ה-JSON הבא מציג חלק מהגדרה לדוגמה:

{
  "android.app.extra.PROVISIONING_LOCALE": "en_GB",
  "android.app.extra.PROVISIONING_TIME_ZONE": "Europe/London",
  "android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED": true,
  "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE": {
    "workflow_type": 3,
    "default_password_quality": 327680,
    "default_min_password_length": 6,
    "company_name": "XYZ Corp",
    "organizational_unit": "sales-uk",
    "management_server": "emm.example.com",
    "detail_tos_url": "https://www.example.com/policies/terms/",
    "allowed_user_domains": "[\"example.com\", \"example.org\", \"example.net\"]"
    }
}

הרשמה דרך הארגון מותקנת ומפעילה את ה-DPC באמצעות אובייקט Intent של Android. המערכת שולחת את הערכים שבנכס android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE מסוג JSON ל-DPC כתוספות ב-Intent. ה-DPC יכול לקרוא את ההגדרות של ניהול התצורה ב-PersistableBundle באמצעות אותם מפתחות.

מומלץ – כדי להגדיר את ה-DPC, תוכלו להשתמש בתוספות Intent הבאות:

לא מומלץ – אל תכללו את התוספות הבאות שעשויות להיות בשימוש בשיטות רישום אחרות:

במאמר הקצאת מכשירים של לקוחות מוסבר איך לחלץ את ההגדרות האלה ולהשתמש בהן בקר DPC.

פיתוח ובדיקה

כדי לפתח ולבדוק את תכונות ההרשמה דרך הארגון במסוף:

  • מכשיר נתמך
  • חשבון בהרשמה דרך הארגון

פיתוח ובדיקה של מכשירים שתומכים בהרשמה דרך הארגון, כמו Google Pixel. אין צורך לרכוש את מכשירי הפיתוח משותף מפיץ.

צרו איתנו קשר כדי לקבל חשבון לקוח לבדיקה וגישה לפורטל ההרשמה דרך הארגון. תוכלו לשלוח לנו אימייל מכתובת האימייל של החברה שלכם שמשויכת לחשבון Google. ציינו את היצרן ואת מספר ה-IMEI של מכשיר אחד או שניים, ונוסיף אותם לחשבון הפיתוח שלכם.

חשוב לזכור: הרשמה דרך הארגון מורידה ומתקיןה באופן אוטומטי DPC, ולכן ה-DPC חייב להיות זמין מ-Google Play כדי שתוכלו לבדוק את ניהול התצורה. אי אפשר לבצע בדיקה באמצעות גרסת פיתוח של בקר DPC.

תמיכה באדמינים ב-IT

אם אתם צריכים לעזור לאדמינים ב-IT בממשק של המסוף או במסמכים שלכם, תוכלו למצוא הנחיות בנושא הרשמה דרך הארגון לאדמינים ב-IT. אפשר גם להפנות את משתמשי המסוף למאמר הרלוונטי במרכז העזרה.

קריאה נוספת

המסמכים הבאים יעזרו לכם לשלב את ההרשמה דרך הארגון במסוף: