الطريقة: delegate
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض هذه المكالمة رمز JSON مميّزًا جديدًا للمصادقة على الويب (JWT) يتيح لكيان الوصول إلى مورد محدّد نيابةً عن المستخدم الذي تمت مصادقته في رمز JWT الأصلي للمصادقة. يتم استخدامها لتفويض
الوصول المحدود النطاق إلى التغليف أو
إزالة التغليف إلى كيان آخر عندما يحتاج هذا الكيان إلى تنفيذ إجراء نيابةً عن المستخدم.
طلب HTTP
POST https://<base_url>/delegate
استبدِل <base_url>
بعنوان URL الخاص بخدمة قائمة التحكّم بالوصول إلى مفاتيح التشفير (KACLS).
مَعلمات المسار
بلا عُري
نص الطلب
يحتوي نص الطلب على تمثيل JSON للطلب:
تمثيل JSON |
{
"authentication": string,
"authorization": string,
"reason": string
}
|
الحقول |
authentication |
string
رمز JWT صادر عن جهة خارجية يؤكّد هوية المستخدم. راجِع قسم المصادقة لمعرفة التفاصيل.
|
authorization |
string
رمز JWT يتضمّن المطالبتَين delegated_to وresource_name اللتين تؤكّدان أنّ الكيان الذي تحدّده المطالبة delegated_to مسموح له بالوصول إلى resource_name نيابةً عن المستخدم. لمزيد من المعلومات، يُرجى الاطّلاع على رموز التفويض.
|
reason |
string (UTF-8)
سلسلة JSON تمريرية توفّر سياقًا إضافيًا حول العملية. يجب تنظيف ملف JSON المقدَّم قبل عرضه. الحد الأقصى للحجم: 1 كيلوبايت
|
خطوات المعالجة المطلوبة
يجب أن تنفّذ خدمة KACLS الخطوات التالية على الأقل:
- التحقّق من صحة رموز التفويض والمصادقة لمزيد من المعلومات، يُرجى الاطّلاع على رموز التفويض ورموز المصادقة.
- تأكَّد من أنّ رموز التفويض والمصادقة تخصّ المستخدم نفسه.
لمزيد من المعلومات، يُرجى الاطّلاع على
تشفير البيانات وفك تشفيرها.
- تأكَّد من أنّ مطالبة
kacls_url
في رمز الإذن تتطابق مع عنوان URL الحالي لخدمة KACLS. ويتيح ذلك رصد الخوادم المحتملة التي تم إعدادها من قِبل أشخاص من الداخل أو مشرفي نطاقات غير مصرح لهم.
- إذا كان الادّعاء
kacls_owner_domain
متوفّرًا في رمز التفويض، تأكَّد من أنّ القيمة تتطابق مع نطاق Google Workspace الخاص بمالك KACLS. يساعد ذلك في منع المستخدمين غير المصرَّح لهم من تسجيل نظام KACLS لدى Google.
- سجِّل العملية، بما في ذلك المستخدم الذي بدأها، و
delegated_to
، وresource_name
، والسبب الذي تم إرساله في الطلب.
- أنشئ رمز JWT مميزًا ووقِّعه وأرجِعه، على أن يحتوي على المطالبات
delegated_to
وresource_name
من رمز التفويض المميز.
يمكن لنظام KACLS إجراء عمليات فحص أمان إضافية مجانًا، بما في ذلك عمليات الفحص المستندة إلى مطالبات JWT.
نص الاستجابة
في حال نجاح العملية، تعرض هذه الطريقة رمز JWT للمصادقة يحتوي على المطالبات delegated_to
وresource_name
. يمكن استخدام هذا الرمز المميز لاحقًا للمصادقة في المكالمات التي يتم إجراؤها باستخدام طريقتَي Wrap وUnwrap. في حال حدوث خطأ، يجب عرض
ردّ خطأ منظَّم.
تمثيل JSON |
{
"delegated_authentication": string
}
|
الحقول |
delegated_authentication |
string
رمز JWT للمصادقة المفوضة صالح للوصول إلى resource_name من قِبل المستخدم المذكور في رمز JWT الأصلي للمصادقة. لمزيد من المعلومات، يُرجى الاطّلاع على رمز المصادقة المميز في KACLS لـ delegate .
|
مثال
طلب
POST https://mykacls.example.com/v1/delegate
{
"authentication": "eyJhbGciOi...",
"authorization": "eyJhbGciOi...delegated_to\":\"other_entity_id\",\"resource_name\":\"meeting_id\"...}",
"reason": "{client:'meet' op:'delegate_access'}"
}
الردّ
{
"delegated_authentication": "eyJhbGciOi...delegated_to_from_authz_token...resource_name_from_authz_token...}"
}
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Method: delegate\n\nThis call returns a new authentication JSON Web Token (JWT) that allows\nan entity to access a specified resource on behalf of the user\nauthenticated in the original authentication JWT. It is used to delegate\nscoped access to [wrap](/workspace/cse/reference/wrap) or\n[unwrap](/workspace/cse/reference/unwrap) to another entity when that\nentity needs to act on behalf of the user.\n\n### HTTP request\n\n`POST https://\u003cbase_url\u003e/delegate`\n\nReplace `\u003cbase_url\u003e` with the Key Access Control List Service (KACLS) URL.\n\n### Path parameters\n\nNone.\n\n### Request body\n\nThe request body contains a JSON representation of the request:\n\n| JSON representation ||\n|---------------------------------------------------------------------------------|---|\n| ``` { \"authentication\": string, \"authorization\": string, \"reason\": string } ``` |\n\n| Fields ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `authentication` | `string` A JWT issued by a third-party asserting who the user is. See the authentication section for details. |\n| `authorization` | `string` A JWT with `delegated_to` and `resource_name` claims asserting that the entity identified by `delegated_to` claim is allowed to access `resource_name` on behalf of the user. For more information, see [Authorization Tokens](/workspace/cse/reference/authorization-tokens). |\n| `reason` | `string (UTF-8)` A passthrough JSON string providing additional context about the operation. The JSON provided should be sanitized before being displayed. Max size: 1 KB. |\n\n### Required processing steps\n\nThe KACLS must perform at least these steps:\n\n- Validate both authorization and authentication tokens. For more information, see [Authorization Tokens](/workspace/cse/reference/authorization-tokens) and [Authentication Tokens](/workspace/cse/reference/authentication-tokens).\n- Check that authorization and authentication tokens are for the same user. For more information, see [Encrypt and decrypt data](/workspace/cse/guides/encrypt-and-decrypt-data).\n- Check that the `kacls_url` claim in the authorization token matches the current KACLS URL. This allows detection of potential man-in-the-middle servers configured by insiders or rogue domain admins.\n- If the `kacls_owner_domain` claim exists in the authorization token, check that the value matches the KACLS owner's Google Workspace domain. This helps prevent unauthorized users from registering your KACLS with Google.\n- Log the operation, including the user originating it, the `delegated_to`, the `resource_name`, and the reason passed in the request.\n- Generate, sign, and return a JWT token containing `delegated_to` and `resource_name` claims from the authorization token.\n\nThe KACLS is free to perform additional security checks, including JWT claim\nbased ones.\n\n### Response body\n\nIf successful, this method returns an authentication JWT containing\n`delegated_to` and `resource_name` claims. This token can later be used for\nauthentication in calls to the Wrap and Unwrap methods. In case of an error, a\n[structured error reply](/workspace/cse/reference/structured-errors)\nshould be returned.\n\n| JSON representation ||\n|------------------------------------------------|---|\n| ``` { \"delegated_authentication\": string } ``` |\n\n| Fields ||\n|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `delegated_authentication` | `string` A delegated authentication JWT valid for accessing `resource_name` by the user mentioned in the original authentication JWT. For more information, see [KACLS authentication token for `delegate`](/workspace/cse/reference/authentication-tokens#kacls_authentication_token_for_delegate). |\n\n### Example\n\n#### Request\n\n POST https://mykacls.example.com/v1/delegate\n {\n \"authentication\": \"eyJhbGciOi...\",\n \"authorization\": \"eyJhbGciOi...delegated_to\\\":\\\"other_entity_id\\\",\\\"resource_name\\\":\\\"meeting_id\\\"...}\",\n \"reason\": \"{client:'meet' op:'delegate_access'}\"\n }\n\n#### Response\n\n {\n \"delegated_authentication\": \"eyJhbGciOi...delegated_to_from_authz_token...resource_name_from_authz_token...}\"\n }"]]