透過跨帳戶防護功能保護使用者帳戶

如果您的應用程式允許使用者透過 Google 登入,您可以監聽並回應跨帳戶防護服務提供的安全性事件通知,提高這些共用使用者帳戶的安全性。

這類通知會提醒您使用者的 Google 帳戶有重大變更,而這些帳戶通常也會對他們的帳戶造成安全風險。舉例來說,如果使用者的 Google 帳戶遭到盜用,就可能透過電子郵件帳戶復原或單一登入功能,導致使用者的帳戶遭到入侵。

為了協助降低這類事件的風險,Google 會傳送名為安全性事件權杖的服務物件。這些符記公開的資訊非常少,僅包括安全性事件的類型和發生時間,以及受影響使用者的 ID,但您可以使用這些權杖來採取適當行動。舉例來說,如果使用者的 Google 帳戶遭到入侵,您可以針對該使用者暫時停用「使用 Google 帳戶登入」功能,避免將帳戶救援電子郵件傳送至使用者的 Gmail 地址。

跨帳戶防護功能是以 OpenID Foundation 開發的 RISC 標準為基礎。

總覽

如要搭配應用程式或服務使用跨帳戶防護功能,您必須完成下列工作:

  1. 在 API Console中設定專案。

  2. 建立事件接收器端點,Google 會將安全性事件權杖傳送至該端點。這個端點會負責驗證其收到的權杖,並以您選擇的方式回應安全性事件。

  3. 向 Google 註冊端點,即可開始接收安全性事件符記。

必要條件

只有在 Google 使用者授予您的服務存取權,才能存取個人資料或電子郵件地址時,您才會收到安全性事件權杖。您可以要求 profileemail 範圍,藉此取得這項權限。根據預設,新版「使用 Google 帳戶登入」或舊版 Google 登入 SDK 會要求這些範圍,但如果您未使用預設設定,或是您直接存取 Google 的 OpenID Connect 端點,請確保您至少要求了其中一個範圍。

在 API Console中設定專案

您必須先建立服務帳戶,並在API Console 專案中啟用 RISC API,才能開始接收安全性事件權杖。您必須在應用程式中使用和存取 Google 服務 (例如 Google 登入) 相同的API Console 專案。

如何建立服務帳戶:

  1. 開啟 API Console Credentials page。在系統提示時,選擇您用於在應用程式中存取 Google 服務的API Console專案。

  2. 按一下「Create credentials」(建立憑證) >「Service account」(服務帳戶)

  3. 請按照這些操作說明,建立新的服務帳戶,並授予 RISC 設定管理員角色 (roles/riscconfigs.admin)。

  4. 為新建立的服務帳戶建立金鑰。選擇 JSON 金鑰類型,然後按一下「Create」(建立)。金鑰建立完成後,您會下載包含服務帳戶憑證的 JSON 檔案。請將這個檔案存放在安全的位置,但也可供事件接收器端點存取。

開啟專案「憑證」頁面時,請記下您用於「使用 Google 帳戶登入」或「Google 登入」(舊版) 的用戶端 ID。通常每個支援的平台都會有用戶端 ID。如下一節所述,您會需要這些用戶端 ID 驗證安全性事件符記。

如要啟用 RISC API:

  1. 在API Console中開啟 RISC API 頁面。確認您用來存取 Google 服務的專案仍為選取狀態。

  2. 詳閱 RISC 條款並確實瞭解相關規定。

    如果要為機構擁有的專案啟用 API,請確認您有權將貴機構繫結至 RISC 條款。

  3. 只有在您同意《RISC 條款》的情況下,才點選「啟用」

建立事件接收器端點

如要接收 Google 提供的安全性事件通知,您必須建立可處理 HTTPS POST 要求的 HTTPS 端點。註冊這個端點後 (請見下方說明),Google 將開始將經過加密簽署的字串 (稱為安全性事件權杖) 發布至端點。安全性事件憑證是已簽署的 JWT,其中包含單一安全性相關事件的資訊。

針對在端點收到的每個安全性事件符記,請先驗證符記並解碼,然後根據服務處理適當的安全性事件。在解碼之前,請務必驗證事件符記,以防止惡意行為人遭受惡意攻擊。下列各節說明這些工作:

1. 解碼並驗證安全性事件符記

由於安全性事件憑證是特定類型的 JWT,您可以使用任何 JWT 程式庫 (例如 jwt.io 上列出的其中一個) 來解碼及驗證。無論您使用哪種程式庫,權杖驗證程式碼都必須執行下列操作:

  1. 您可以在 Google 的 RISC 設定文件中,取得跨帳戶防護核發機構 ID (issuer) 和簽署金鑰憑證 URI (jwks_uri),詳情請參閱 https://accounts.google.com/.well-known/risc-configuration
  2. 使用您選擇的 JWT 程式庫,從安全性事件權杖的標頭取得簽署金鑰 ID。
  3. 從 Google 的簽署金鑰憑證文件中,使用您在上一個步驟取得的金鑰 ID 取得公開金鑰。如果文件未包含具有所需 ID 的金鑰,可能是因為安全性事件憑證無效,且您的端點應傳回 HTTP 錯誤 400。
  4. 使用您選擇的 JWT 程式庫驗證下列項目:
    • 使用在上一個步驟取得的公開金鑰簽署安全性事件權杖。
    • 權杖的 aud 憑證附加資訊是應用程式的其中一個用戶端 ID。
    • 權杖的 iss 憑證附加資訊與 RISC 探索文件中提供的發卡機構 ID 相符。請注意,您不需要驗證權杖的到期時間 (exp),因為安全性事件權杖代表歷史事件,因此不會過期。

例如:

Java

使用 java-jwtjwks-rsa-java

public DecodedJWT validateSecurityEventToken(String token) {
    DecodedJWT jwt = null;
    try {
        // In a real implementation, get these values from
        // https://accounts.google.com/.well-known/risc-configuration
        String issuer = "accounts.google.com";
        String jwksUri = "https://www.googleapis.com/oauth2/v3/certs";

        // Get the ID of the key used to sign the token.
        DecodedJWT unverifiedJwt = JWT.decode(token);
        String keyId = unverifiedJwt.getKeyId();

        // Get the public key from Google.
        JwkProvider googleCerts = new UrlJwkProvider(new URL(jwksUri), null, null);
        PublicKey publicKey = googleCerts.get(keyId).getPublicKey();

        // Verify and decode the token.
        Algorithm rsa = Algorithm.RSA256((RSAPublicKey) publicKey, null);
        JWTVerifier verifier = JWT.require(rsa)
                .withIssuer(issuer)
                // Get your apps' client IDs from the API console:
                // https://console.developers.google.com/apis/credentials?project=_
                .withAudience("123456789-abcedfgh.apps.googleusercontent.com",
                              "123456789-ijklmnop.apps.googleusercontent.com",
                              "123456789-qrstuvwx.apps.googleusercontent.com")
                .acceptLeeway(Long.MAX_VALUE)  // Don't check for expiration.
                .build();
        jwt = verifier.verify(token);
    } catch (JwkException e) {
        // Key not found. Return HTTP 400.
    } catch (InvalidClaimException e) {

    } catch (JWTDecodeException exception) {
        // Malformed token. Return HTTP 400.
    } catch (MalformedURLException e) {
        // Invalid JWKS URI.
    }
    return jwt;
}

Python

import json
import jwt       # pip install pyjwt
import requests  # pip install requests

def validate_security_token(token, client_ids):
    # Get Google's RISC configuration.
    risc_config_uri = 'https://accounts.google.com/.well-known/risc-configuration'
    risc_config = requests.get(risc_config_uri).json()

    # Get the public key used to sign the token.
    google_certs = requests.get(risc_config['jwks_uri']).json()
    jwt_header = jwt.get_unverified_header(token)
    key_id = jwt_header['kid']
    public_key = None
    for key in google_certs['keys']:
        if key['kid'] == key_id:
            public_key = jwt.algorithms.RSAAlgorithm.from_jwk(json.dumps(key))
    if not public_key:
        raise Exception('Public key certificate not found.')
        # In this situation, return HTTP 400

    # Decode the token, validating its signature, audience, and issuer.
    try:
        token_data = jwt.decode(token, public_key, algorithms='RS256',
                                options={'verify_exp': False},
                                audience=client_ids, issuer=risc_config['issuer'])
    except:
        raise
        # Validation failed. Return HTTP 400.
    return token_data

# Get your apps' client IDs from the API console:
# https://console.developers.google.com/apis/credentials?project=_
client_ids = ['123456789-abcedfgh.apps.googleusercontent.com',
              '123456789-ijklmnop.apps.googleusercontent.com',
              '123456789-qrstuvwx.apps.googleusercontent.com']
token_data = validate_security_token(token, client_ids)

如果權杖有效且成功解碼,則傳回 HTTP 狀態 202。然後處理權杖指定的安全性事件。

2. 處理安全性事件

解碼後,安全性事件權杖如下所示:

{
  "iss": "https://accounts.google.com/",
  "aud": "123456789-abcedfgh.apps.googleusercontent.com",
  "iat": 1508184845,
  "jti": "756E69717565206964656E746966696572",
  "events": {
    "https://schemas.openid.net/secevent/risc/event-type/account-disabled": {
      "subject": {
        "subject_type": "iss-sub",
        "iss": "https://accounts.google.com/",
        "sub": "7375626A656374"
      },
      "reason": "hijacking"
    }
  }
}

issaud 憑證附加資訊會指出權杖的核發者 (Google) 和權杖的接收者 (您的服務)。您已在上一個步驟中驗證這些聲明。

jti 憑證附加資訊是識別單一安全性事件的字串,且對於串流來說是唯一的。您可以使用此 ID 追蹤您已收到的安全性事件。

events 憑證附加資訊包含權杖代表的安全性事件相關資訊。此憑證附加資訊是從事件類型 ID 對應至 subject 憑證附加資訊,用於指定此事件疑慮的使用者,以及可能可用事件的其他相關詳細資料。

subject 憑證附加資訊會透過使用者的專屬 Google 帳戶 ID (sub) 識別特定使用者。這個 Google 帳戶 ID 與新版「使用 Google 帳戶登入」功能 (JavaScriptHTML) 程式庫、舊版 Google 登入程式庫或 OpenID Connect 所核發的 JWT ID 權杖相同。sub當憑證的 subject_typeid_token_claims 時,也可能包含 email 欄位以及使用者電子郵件地址。

請使用 events 憑證附加資訊中的資訊,對指定使用者帳戶的事件類型採取適當行動。

OAuth 權杖 ID

針對個別權杖的 OAuth 事件,符記主體 ID 類型包含下列欄位:

  • token_type:僅支援 refresh_token

  • token_identifier_alg:請參閱下表,瞭解可能的值。

  • token:請參閱下表。

token_identifier_alg 權杖
prefix 權杖的前 16 個字元。
hash_base64_sha512_sha512 使用 SHA-512 的權杖雙雜湊。

如果您整合了這些事件,建議您根據這些可能的值為權杖建立索引,以確保收到事件後能快速比對。

支援的事件類型

跨帳戶防護功能支援以下類型的安全性事件:

事件類型 Attributes 回應方式
https://schemas.openid.net/secevent/risc/event-type/sessions-revoked 必要:結束目前開啟的工作階段,重新保護使用者的帳戶。
https://schemas.openid.net/secevent/oauth/event-type/tokens-revoked

必要:如果權杖適用於 Google 登入,請終止目前開啟的工作階段。此外,建議您建議使用者設定其他登入方式。

建議事項:如果權杖的用途是存取其他 Google API,請刪除您儲存的任何使用者 OAuth 權杖。

https://schemas.openid.net/secevent/oauth/event-type/token-revoked 如要查看權杖 ID,請參閱「OAuth 權杖 ID」一節

必要:如果您儲存了對應的更新權杖,請刪除該權杖,並在下次需要存取權杖時要求使用者重新同意。

https://schemas.openid.net/secevent/risc/event-type/account-disabled reason=hijacking
reason=bulk-account

必要:如果帳戶停用的原因為 hijacking,請結束使用者目前開啟的工作階段,以再次保護使用者的帳戶。

建議:如果帳戶停用的原因為 bulk-account,請分析使用者在服務中的活動,並決定適當的後續行動。

建議:如果未提供原因,請為使用者停用 Google 登入功能,並使用與使用者 Google 帳戶相關聯的電子郵件地址 (通常不一定是 Gmail 帳戶) 停用帳戶救援功能。為使用者提供其他登入方式。

https://schemas.openid.net/secevent/risc/event-type/account-enabled 建議:為使用者重新啟用 Google 登入功能,並透過使用者的 Google 帳戶電子郵件地址重新啟用帳戶救援功能。
https://schemas.openid.net/secevent/risc/event-type/account-credential-change-required 建議:留意服務是否有可疑活動,並採取適當行動。
https://schemas.openid.net/secevent/risc/event-type/verification state=state 建議:記錄已收到測試權杖。

重複和遺漏的活動

跨帳戶防護功能會嘗試重新提交您認為未送達的事件。因此,您可能會多次收到同一事件。如果這可能會造成重複執行動作,對使用者造成不便,請考慮使用 jti 憑證附加資訊 (是事件的專屬 ID) 刪除事件。有些外部工具 (例如 Google Cloud Dataflow) 可協助您執行清除簡化的 Dataflow。

請注意,事件的重試作業有限,因此如果接收器長時間停止運作,可能會永久錯過某些事件。

註冊接收者

如要開始接收安全性事件,請使用 RISC API 註冊接收器端點。對 RISC API 的呼叫必須附帶授權權杖。

您只會收到應用程式使用者的安全性事件,因此您必須先在 GCP 專案中設定 OAuth 同意畫面,才能執行以下步驟。

1. 產生授權權杖

如要產生 RISC API 的授權權杖,請建立含有下列憑證附加資訊的 JWT:

{
  "iss": SERVICE_ACCOUNT_EMAIL,
  "sub": SERVICE_ACCOUNT_EMAIL,
  "aud": "https://risc.googleapis.com/google.identity.risc.v1beta.RiscManagementService",
  "iat": CURRENT_TIME,
  "exp": CURRENT_TIME + 3600
}

使用服務帳戶的私密金鑰簽署 JWT,您可以在建立服務帳戶金鑰時下載的 JSON 檔案中找到這組金鑰。

例如:

Java

使用 java-jwtGoogle 的驗證程式庫

public static String makeBearerToken() {
    String token = null;
    try {
        // Get signing key and client email address.
        FileInputStream is = new FileInputStream("your-service-account-credentials.json");
        ServiceAccountCredentials credentials =
               (ServiceAccountCredentials) GoogleCredentials.fromStream(is);
        PrivateKey privateKey = credentials.getPrivateKey();
        String keyId = credentials.getPrivateKeyId();
        String clientEmail = credentials.getClientEmail();

        // Token must expire in exactly one hour.
        Date issuedAt = new Date();
        Date expiresAt = new Date(issuedAt.getTime() + 3600000);

        // Create signed token.
        Algorithm rsaKey = Algorithm.RSA256(null, (RSAPrivateKey) privateKey);
        token = JWT.create()
                .withIssuer(clientEmail)
                .withSubject(clientEmail)
                .withAudience("https://risc.googleapis.com/google.identity.risc.v1beta.RiscManagementService")
                .withIssuedAt(issuedAt)
                .withExpiresAt(expiresAt)
                .withKeyId(keyId)
                .sign(rsaKey);
    } catch (ClassCastException e) {
        // Credentials file doesn't contain a service account key.
    } catch (IOException e) {
        // Credentials file couldn't be loaded.
    }
    return token;
}

Python

import json
import time

import jwt  # pip install pyjwt

def make_bearer_token(credentials_file):
    with open(credentials_file) as service_json:
        service_account = json.load(service_json)
        issuer = service_account['client_email']
        subject = service_account['client_email']
        private_key_id = service_account['private_key_id']
        private_key = service_account['private_key']
    issued_at = int(time.time())
    expires_at = issued_at + 3600
    payload = {'iss': issuer,
               'sub': subject,
               'aud': 'https://risc.googleapis.com/google.identity.risc.v1beta.RiscManagementService',
               'iat': issued_at,
               'exp': expires_at}
    encoded = jwt.encode(payload, private_key, algorithm='RS256',
                         headers={'kid': private_key_id})
    return encoded

auth_token = make_bearer_token('your-service-account-credentials.json')

此授權權杖可用來進行 RISC API 呼叫一小時。權杖到期後,請產生新的權杖以繼續執行 RISC API 呼叫。

2. 呼叫 RISC 串流設定 API

現在您已取得授權權杖,可以使用 RISC API 設定專案的安全性事件串流,包括註冊接收器端點。

如要執行此操作,請向 https://risc.googleapis.com/v1beta/stream:update 提出 HTTPS POST 要求,指定您要的接收器端點和您感興趣的安全性事件類型

POST /v1beta/stream:update HTTP/1.1
Host: risc.googleapis.com
Authorization: Bearer AUTH_TOKEN

{
  "delivery": {
    "delivery_method":
      "https://schemas.openid.net/secevent/risc/delivery-method/push",
    "url": RECEIVER_ENDPOINT
  },
  "events_requested": [
    SECURITY_EVENT_TYPES
  ]
}

例如:

Java

public static void configureEventStream(final String receiverEndpoint,
                                        final List<String> eventsRequested,
                                        String authToken) throws IOException {
    ObjectMapper jsonMapper = new ObjectMapper();
    String streamConfig = jsonMapper.writeValueAsString(new Object() {
        public Object delivery = new Object() {
            public String delivery_method =
                    "https://schemas.openid.net/secevent/risc/delivery-method/push";
            public String url = receiverEndpoint;
        };
        public List<String> events_requested = eventsRequested;
    });

    HttpPost updateRequest = new HttpPost("https://risc.googleapis.com/v1beta/stream:update");
    updateRequest.addHeader("Content-Type", "application/json");
    updateRequest.addHeader("Authorization", "Bearer " + authToken);
    updateRequest.setEntity(new StringEntity(streamConfig));

    HttpResponse updateResponse = new DefaultHttpClient().execute(updateRequest);
    Header[] responseContentTypeHeaders = updateResponse.getHeaders("Content-Type");
    StatusLine responseStatus = updateResponse.getStatusLine();
    int statusCode = responseStatus.getStatusCode();
    HttpEntity entity = updateResponse.getEntity();
    // Now handle response
}

// ...

configureEventStream(
        "https://your-service.example.com/security-event-receiver",
        Arrays.asList(
                "https://schemas.openid.net/secevent/risc/event-type/account-credential-change-required",
                "https://schemas.openid.net/secevent/risc/event-type/account-disabled"),
        authToken);

Python

import requests

def configure_event_stream(auth_token, receiver_endpoint, events_requested):
    stream_update_endpoint = 'https://risc.googleapis.com/v1beta/stream:update'
    headers = {'Authorization': 'Bearer {}'.format(auth_token)}
    stream_cfg = {'delivery': {'delivery_method': 'https://schemas.openid.net/secevent/risc/delivery-method/push',
                               'url': receiver_endpoint},
                  'events_requested': events_requested}
    response = requests.post(stream_update_endpoint, json=stream_cfg, headers=headers)
    response.raise_for_status()  # Raise exception for unsuccessful requests

configure_event_stream(auth_token, 'https://your-service.example.com/security-event-receiver',
                       ['https://schemas.openid.net/secevent/risc/event-type/account-credential-change-required',
                        'https://schemas.openid.net/secevent/risc/event-type/account-disabled'])

如果要求傳回 HTTP 200,表示事件串流已成功設定,且接收器端點應該會開始接收安全性事件憑證。下一節將說明如何測試串流設定與端點,確認所有項目都能正常運作。

取得並更新目前的串流設定

日後如要修改串流設定,可以向 https://risc.googleapis.com/v1beta/stream 提出授權的 GET 要求來取得目前的串流設定,修改回應主體,然後將修改過的設定發布回 https://risc.googleapis.com/v1beta/stream:update (如上所述)。

停止及繼續事件串流

如果您需要停止來自 Google 的事件串流,請在要求主體中使用 { "status": "disabled" }https://risc.googleapis.com/v1beta/stream/status:update 提出已授權的 POST 要求。串流停用時,Google 不會將事件傳送至端點,也不會在發生安全性事件時緩衝處理。如要重新啟用事件串流,請將 { "status": "enabled" } 張貼至相同端點。

3. 選用:測試串流設定

您可以透過事件串流傳送驗證權杖,藉此驗證串流設定和接收器端點是否正常運作。此憑證可包含不重複的字串,可用來驗證已在端點收到憑證。如要使用此流程,請務必在註冊接收端時訂閱 https://schemas.openid.net/secevent/risc/event-type/verification 事件類型。

如要要求驗證權杖,請向 https://risc.googleapis.com/v1beta/stream:verify 發出授權的 HTTPS POST 要求。在要求主體中,指定一些可識別字串:

{
  "state": "ANYTHING"
}

例如:

Java

public static void testEventStream(final String stateString,
                                   String authToken) throws IOException {
    ObjectMapper jsonMapper = new ObjectMapper();
    String json = jsonMapper.writeValueAsString(new Object() {
        public String state = stateString;
    });

    HttpPost updateRequest = new HttpPost("https://risc.googleapis.com/v1beta/stream:verify");
    updateRequest.addHeader("Content-Type", "application/json");
    updateRequest.addHeader("Authorization", "Bearer " + authToken);
    updateRequest.setEntity(new StringEntity(json));

    HttpResponse updateResponse = new DefaultHttpClient().execute(updateRequest);
    Header[] responseContentTypeHeaders = updateResponse.getHeaders("Content-Type");
    StatusLine responseStatus = updateResponse.getStatusLine();
    int statusCode = responseStatus.getStatusCode();
    HttpEntity entity = updateResponse.getEntity();
    // Now handle response
}

// ...

testEventStream("Test token requested at " + new Date().toString(), authToken);

Python

import requests
import time

def test_event_stream(auth_token, nonce):
    stream_verify_endpoint = 'https://risc.googleapis.com/v1beta/stream:verify'
    headers = {'Authorization': 'Bearer {}'.format(auth_token)}
    state = {'state': nonce}
    response = requests.post(stream_verify_endpoint, json=state, headers=headers)
    response.raise_for_status()  # Raise exception for unsuccessful requests

test_event_stream(auth_token, 'Test token requested at {}'.format(time.ctime()))

如果要求成功,系統會將驗證權杖傳送至您註冊的端點。接著,如果您的端點僅透過記錄權杖來處理驗證權杖,您可以檢查記錄來確認已收到該權杖。

錯誤代碼參考資料

RISC API 可能會傳回下列錯誤:

錯誤代碼 錯誤訊息 建議採取的動作
400 串流設定必須包含 $fieldname 欄位。 您傳送至 https://risc.googleapis.com/v1beta/stream:update 端點的要求無效,或是無法剖析。請在要求中加入$fieldname
401 未經授權。 無法提供授權,請確認您在要求中附加了 授權權杖,且權杖有效且尚未過期。
403 傳送端點必須是 HTTPS 網址。 傳送端點 (即您預期 RISC 事件會傳送至的端點) 必須是 HTTPS。我們不會將 RISC 事件傳送至 HTTP 網址。
403 現有串流設定沒有符合規格要求的 RISC 放送方法。 您的 Google Cloud 專案必須具有 RISC 設定。如果您使用 Firebase 且已啟用 Google 登入功能,Firebase 就會管理專案的 RISC,您將無法建立自訂設定。如果您並未將 Google 登入用於 Firebase 專案,請停用該專案,並在一小時後再次嘗試更新。
403 找不到專案。 請確認您使用正確的服務帳戶執行正確的專案。您可能使用的是與已刪除的專案相關聯的服務帳戶。 瞭解如何查看與專案相關聯的所有服務帳戶
403 服務帳戶需要權限,才能存取您的 RISC 設定 請前往專案的 API Console ,並按照這些操作說明,將「RISC 設定管理員」角色 (roles/riscconfigs.admin) 指派給用於呼叫您專案的服務帳戶。
403 只有服務帳戶才能呼叫 Stream Management API, 進一步瞭解如何使用服務帳戶呼叫 Google API
403 傳送端點不屬於您的專案的任何網域。 每個專案都有一組授權網域。如果您的傳送端點 (即您預期 RISC 事件傳送至的端點) 並非在其中一個託管端點上,您必須為該端點新增端點的網域。
403 如要使用這個 API,您的專案必須設定至少一個 OAuth 用戶端。 只有在您建構支援 Google 登入的應用程式時,RISC 才能正常運作。這個連線需要 OAuth 用戶端。如果專案沒有 OAuth 用戶端,RISC 可能不適用於您。進一步瞭解 Google 對我們的 API 使用 OAuth
403

不支援的狀態。

狀態無效。

目前僅支援「enabled」和「disabled」串流狀態。
404

專案沒有 RISC 設定。

專案目前沒有 RISC 設定,因此無法更新狀態。

呼叫 https://risc.googleapis.com/v1beta/stream:update 端點來建立新的串流設定。
4XX/5XX 無法更新狀態。 請查看詳細錯誤訊息瞭解詳情。

存取權杖範圍

如果您決定使用存取權杖驗證 RISC API,應用程式必須要求以下範圍:

端點 範圍
https://risc.googleapis.com/v1beta/stream/status https://www.googleapis.com/auth/risc.status.readonlyhttps://www.googleapis.com/auth/risc.status.readwrite
https://risc.googleapis.com/v1beta/stream/status:update https://www.googleapis.com/auth/risc.status.readwrite
https://risc.googleapis.com/v1beta/stream https://www.googleapis.com/auth/risc.configuration.readonlyhttps://www.googleapis.com/auth/risc.configuration.readwrite
https://risc.googleapis.com/v1beta/stream:update https://www.googleapis.com/auth/risc.configuration.readwrite
https://risc.googleapis.com/v1beta/stream:verify https://www.googleapis.com/auth/risc.verify

需要協助嗎?

首先,請查看我們的錯誤代碼參考資料一節。如果仍有問題,請在 Stack Overflow 上張貼問題並加上 #SecEvents 標記。