Mã thông báo xác thực
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Mã thông báo của người mang (JWT: RFC 7516) do đối tác nhận dạng (IdP) phát hành để chứng thực danh tính của người dùng.
Biểu diễn dưới dạng JSON |
{
"aud": string,
"email": string,
"exp": string,
"iat": string,
"iss": string,
"google_email": string,
...
}
|
Trường |
aud |
string
Đối tượng, do IdP xác định. Cần được kiểm tra dựa trên cấu hình trên thiết bị.
|
email |
string (UTF-8)
Địa chỉ email của người dùng.
|
exp |
string
Thời gian hết hạn.
|
iat |
string
Thời gian phát hành.
|
iss |
string
Tổ chức phát hành mã thông báo. Phải được xác thực dựa trên bộ phát hành xác thực đáng tin cậy.
|
google_email |
string
Một khai báo không bắt buộc, được dùng khi khai báo email trong JWT này khác với mã nhận dạng email Google Workspace của người dùng. Thông tin xác nhận này mang danh tính email Google Workspace của người dùng.
|
... |
Dịch vụ Danh sách kiểm soát quyền truy cập khoá (KACLS) của bạn có thể sử dụng miễn phí mọi thông tin xác nhận quyền sở hữu khác (vị trí, thông tin xác nhận quyền sở hữu tuỳ chỉnh, v.v.) để đánh giá phạm vi.
|
Mã thông báo xác thực KACLS cho delegate
Mã thông báo xác thực chứa một Mã thông báo web JSON (JWT) (JWT: RFC 7516) là mã thông báo xác thực của người mang.
Đôi khi, người dùng không thể xác thực trực tiếp trên một ứng dụng.
Trong những trường hợp này, người dùng có thể uỷ quyền truy cập vào một tài nguyên cụ thể cho ứng dụng đó. Việc này được thực hiện bằng cách phát hành một mã thông báo xác thực được uỷ quyền mới, mã thông báo này sẽ giới hạn phạm vi của mã thông báo xác thực ban đầu.
Mã thông báo xác thực được uỷ quyền tương tự như mã thông báo xác thực thông thường, nhưng có thêm một câu lệnh:
tuyên bố |
delegated_to |
string
Giá trị nhận dạng của thực thể để uỷ quyền xác thực.
|
Trong ngữ cảnh uỷ quyền, yêu cầu resource_name
trong mã thông báo xác thực được dùng để xác định đối tượng được mã hoá bằng Khoá mã hoá dữ liệu (DEK) mà hoạt động uỷ quyền có hiệu lực.
Mã thông báo này do Dịch vụ danh sách kiểm soát quyền truy cập khoá (KACLS) phát hành bằng lệnh gọi Delegate
. Đó có thể là JWT tự ký mà KACLS có thể xác thực, hoặc KACLS có thể sử dụng bất kỳ IdP nào khác để thực hiện việc đó thông qua một lệnh gọi đáng tin cậy.
Để mã thông báo xác thực được uỷ quyền được coi là hợp lệ, bạn phải cung cấp mã thông báo uỷ quyền được uỷ quyền cho cùng một thao tác. Mã uỷ quyền được uỷ quyền tương tự như mã uỷ quyền thông thường, nhưng có thêm giá trị xác nhận delegated_to
. Giá trị của các xác nhận quyền sở hữu delegated_to
và resource_name
phải khớp với các giá trị trong mã thông báo xác thực được uỷ quyền.
Bạn nên đặt giá trị thời gian tồn tại là 15 phút cho mã thông báo xác thực được uỷ quyền để tránh trường hợp có thể sử dụng lại trong trường hợp bị rò rỉ.
Biểu diễn dưới dạng JSON |
{
"email": string,
"iss": string,
"aud": string,
"exp": string,
"iat": string,
"google_email": string,
"delegated_to": string,
"resource_name": string
...
}
|
Trường |
email |
string (UTF-8)
Địa chỉ email của người dùng ở định dạng UTF-8.
|
iss |
string
Trình phát hành mã thông báo phải được xác thực dựa trên bộ trình phát hành xác thực đáng tin cậy.
|
aud |
string
Đối tượng, do IdP xác định. Cần được kiểm tra dựa trên cấu hình trên thiết bị.
|
exp |
string
Bạn nên kiểm tra thời gian hết hạn.
|
iat |
string
Thời gian phát hành, bạn nên kiểm tra.
|
delegated_to |
string
Giá trị nhận dạng của thực thể để uỷ quyền xác thực.
|
resource_name |
string
Giá trị nhận dạng của đối tượng được mã hoá bằng DEK, mà việc uỷ quyền là hợp lệ.
|
... |
KACLS có thể sử dụng miễn phí mọi thông tin xác nhận quyền sở hữu khác (vị trí, thông tin xác nhận quyền sở hữu tuỳ chỉnh, v.v.) để đánh giá chu vi.
|
Mã thông báo xác thực KACLS cho PrivilegedUnwrap
Mã thông báo của người mang (JWT: RFC 7516) do đối tác nhận dạng (IdP) phát hành để chứng thực danh tính của người dùng.
Chỉ dùng trên PrivilegedUnwrap
. Trong PrivilegedUnwrap
, nếu JWT KACLS được dùng thay cho mã thông báo xác thực IDP, thì KACLS nhận phải tìm nạp JWKS của nhà phát hành trước, sau đó xác minh chữ ký mã thông báo, trước khi kiểm tra các xác nhận quyền sở hữu.
Biểu diễn dưới dạng JSON |
{
"aud": string,
"exp": string,
"iat": string,
"iss": string,
"kacls_url": string,
"resource_name": string
...
}
|
Trường |
aud |
string
Đối tượng, do IdP xác định. Đối với các thao tác PrivilegedUnwrap mã hoá phía máy khách (CSE) của Drive, đây phải là kacls-migration .
|
exp |
string
Thời gian hết hạn.
|
iat |
string
Thời gian phát hành.
|
iss |
string
Tổ chức phát hành mã thông báo. Phải được xác thực dựa trên bộ phát hành xác thực đáng tin cậy. Phải khớp với KACLS_URL của KACLS yêu cầu. Bạn có thể tìm thấy bộ khoá công khai của đơn vị phát hành tại /certs .
|
kacls_url |
string
URL của KACLS hiện tại mà dữ liệu đang được giải mã.
|
resource_name |
string
Giá trị nhận dạng của đối tượng được mã hoá bằng DEK. Kích thước tối đa: 128 byte.
|
... |
Dịch vụ Danh sách kiểm soát quyền truy cập khoá (KACLS) của bạn có thể sử dụng miễn phí mọi thông tin xác nhận quyền sở hữu khác (vị trí, thông tin xác nhận quyền sở hữu tuỳ chỉnh, v.v.) để đánh giá phạm vi.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-04 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-04 UTC."],[[["\u003cp\u003eKACLS uses bearer tokens (JWTs) issued by an identity provider (IdP) to verify user identity and authorize access.\u003c/p\u003e\n"],["\u003cp\u003eJWTs contain essential claims like audience, email, expiration, issuance, issuer, and potentially a Google Workspace email for specific scenarios.\u003c/p\u003e\n"],["\u003cp\u003eFor \u003ccode\u003ePrivilegedUnwrap\u003c/code\u003e operations, a KACLS JWT is used, requiring the recipient KACLS to verify the token signature and claims after fetching the issuer's JWKS.\u003c/p\u003e\n"],["\u003cp\u003eKACLS JWTs include specific claims like \u003ccode\u003ekacls_url\u003c/code\u003e and \u003ccode\u003eresource_name\u003c/code\u003e relevant to the decryption process.\u003c/p\u003e\n"],["\u003cp\u003eKACLS offers flexibility by allowing the use of additional claims for perimeter evaluation and custom authorization logic.\u003c/p\u003e\n"]]],["The document outlines two types of Bearer tokens (JWTs) used for user identity and KACLS authentication. User identity tokens, issued by the IdP, include fields like `aud`, `email`, `exp`, `iat`, `iss`, and `google_email` for email verification. KACLS authentication tokens, used during `PrivilegedUnwrap`, contain `aud` (specifically `kacls-migration`), `exp`, `iat`, `iss`, `kacls_url`, and `resource_name`. KACLS must verify the KACLS JWT's signature and claims after fetching the issuer's JWKS. Both types allow for custom claims.\n"],null,["# Authentication tokens\n\nBearer token ([JWT: RFC 7516](https://tools.ietf.org/html/rfc7516))\nissued by the identity partner (IdP) to attest a user's identity.\n\n| JSON representation ||\n|----------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"aud\": string, \"email\": string, \"exp\": string, \"iat\": string, \"iss\": string, \"google_email\": string, ... } ``` |\n\n| Fields ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `aud` | `string` The audience, as identified by the IdP. Should be checked against the local configuration. |\n| `email` | `string (UTF-8)` The user's email address. |\n| `exp` | `string` Expiration time. |\n| `iat` | `string` Issuance time. |\n| `iss` | `string` The token issuer. Should be validated against the trusted set of authentication issuers. |\n| `google_email` | `string` An optional claim, to be used when the email claim in this JWT is different from the user's Google Workspace email ID. This claim carries the user's Google Workspace email identity. |\n| `...` | Your Key Access Control List Service (KACLS) is free to use any other claims (location, custom claim, etc) to evaluate the perimeter. |\n\nKACLS authentication token for `delegate`\n-----------------------------------------\n\nThe authentication token contains a JSON Web Token (JWT) ([JWT: RFC 7516](https://tools.ietf.org/html/rfc7516))\nthat is a bearer authentication token.\n\nSometimes a user is not able to authenticate on a client directly.\nIn these cases the user can delegate their access to a specific\nresource to that client. This is achieved through issuing a new\ndelegated authentication token that limits the scope of the original\nauthentication token.\n\nThe delegated authentication token is similar to the ordinary\nauthentication token with one additional claim:\n\n| claim ||\n|----------------|----------------------------------------------------------------------|\n| `delegated_to` | `string` An identifier for the entity to delegate authentication to. |\n\nThe `resource_name` claim in the authentication token is, in a\ndelegation context, used for identifying the object encrypted by the\nData Encryption Key (DEK) for which the delegation is valid.\n\nThe token is issued by the Key Access Control List Service (KACLS)\nusing the `Delegate` call. It may be either self-signed JWTs\nthat KACLS is able to validate, or KACLS may use any other IdP to do\nthat, through a trusted call.\n\nIn order for the delegated authentication token to be considered valid, a\ndelegated authorization token must be provided for the same operation. The\ndelegated authorization token is similar to the ordinary authorization token,\nbut contains the additional claim `delegated_to`. The values of the\n`delegated_to` and `resource_name` claims must match the values in the\ndelegated authentication token.\n\nWe recommend that you set a lifetime value of 15 minutes for the delegated\nauthentication tokens to avoid potential reuse in case of leakage.\n\n| JSON representation ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"email\": string, \"iss\": string, \"aud\": string, \"exp\": string, \"iat\": string, \"google_email\": string, \"delegated_to\": string, \"resource_name\": string ... } ``` |\n\n| Fields ||\n|-----------------|-------------------------------------------------------------------------------------------------------|\n| `email` | `string (UTF-8)` The user's UTF-8 formatted email address. |\n| `iss` | `string` The token issuer, should be validated against the trusted set of authentication issuers. |\n| `aud` | `string` The audience, as identified by the IdP. Should be checked against the local configuration. |\n| `exp` | `string` Expiration time, should be checked. |\n| `iat` | `string` Issuance time, should be checked. |\n| `delegated_to` | `string` An identifier for the entity to delegate authentication to. |\n| `resource_name` | `string` An identifier for the object encrypted by the DEK, for which the delegation is valid. |\n| `...` | The KACLS is free to use any other claims (location, custom claim, etc...) to evaluate the perimeter. |\n\nKACLS authentication token for `PrivilegedUnwrap`\n-------------------------------------------------\n\nBearer token ([JWT: RFC 7516](https://tools.ietf.org/html/rfc7516))\nissued by the identity partner (IdP) to attest a user's identity.\n\nThis is only used on `PrivilegedUnwrap`. During `PrivilegedUnwrap`, if a KACLS\nJWT is used in place of an IDP authentication token, the recipient KACLS must\nfirst fetch the JWKS of the issuer, then verify the token signature, before\nchecking the claims.\n\n| JSON representation ||\n|--------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"aud\": string, \"exp\": string, \"iat\": string, \"iss\": string, \"kacls_url\": string, \"resource_name\": string ... } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `aud` | `string` The audience, as identified by the IdP. For Drive client-side encryption (CSE) `PrivilegedUnwrap` operations, this should be `kacls-migration`. |\n| `exp` | `string` Expiration time. |\n| `iat` | `string` Issuance time. |\n| `iss` | `string` The token issuer. Should be validated against the trusted set of authentication issuers. Must match the `KACLS_URL` of the requesting KACLS. The public key set of the issuer can be found at /certs. |\n| `kacls_url` | `string` URL of current KACLS, that the data is being decrypted on. |\n| `resource_name` | `string` An identifier for the object encrypted by the DEK. Maximum size: 128 bytes. |\n| `...` | Your Key Access Control List Service (KACLS) is free to use any other claims (location, custom claim, etc) to evaluate the perimeter. |"]]