Authentication
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
google.maps.journeySharing.AuthToken
介面
權杖擷取器傳回的驗證權杖。
google.maps.journeySharing.AuthTokenContext
介面
包含鑄造 JSON Web Token 所需的其他資訊。
屬性 |
deliveryVehicleId optional |
類型: string optional
如果提供,則鑄造的權杖應具有私人 DeliveryVehicleId 聲明,適用於提供的 deliveryVehicleId。 |
taskId optional |
類型: string optional
提供時,鑄造的權杖應具有提供的 taskId 的私人 TaskId 權杖。 |
trackingId optional |
類型: string optional
如果提供,則鑄造的權杖應具有私人 TrackingId 聲明,適用於提供的追蹤 ID。 |
tripId optional |
類型: string optional
提供此資訊時,鑄造的權杖應具有私人 TripId 聲明,適用於提供的 tripId。 |
vehicleId optional |
類型: string optional
如果提供此值,則鑄造的權杖應具有針對提供的 vehicleId 的私人 VehicleId 要求。 |
google.maps.journeySharing.AuthTokenFetcherOptions
介面
驗證權杖擷取器的選項。
屬性 |
context |
驗證權杖的脈絡。您應將在內容中指定的 ID 新增至傳送至 JSON Web Token 鑄造端點的要求中。 |
serviceType |
Fleet Engine 服務類型。 |
google.maps.journeySharing.FleetEngineServiceType
常數
Fleet Engine 服務類型。
請呼叫 const {FleetEngineServiceType} = await google.maps.importLibrary("journeySharing")
存取。請參閱「Maps JavaScript API 中的程式庫」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-22 (世界標準時間)。
[null,null,["上次更新時間:2024-12-22 (世界標準時間)。"],[],[],null,["# Authentication\n\nThe documentation for has moved to a different page.\n\nThe documentation for the linked item could not be found. \n\n[AuthToken](#AuthToken)\ninterface\n---------------------------------\n\n\ngoogle.maps.journeySharing`.`AuthToken\ninterface\n\nThe auth token returned by the token fetcher.\n\n| ### Properties ||\n|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| [expiresInSeconds](#AuthToken.expiresInSeconds) | **Type:** `number` The expiration time in seconds. A token expires in this amount of time after fetching. |\n| [token](#AuthToken.token) | **Type:** `string` The token. |\n\n[AuthTokenContext](#AuthTokenContext)\ninterface\n-----------------------------------------------\n\n\ngoogle.maps.journeySharing`.`AuthTokenContext\ninterface\n\nContains additional information needed to mint JSON Web Tokens.\n\n| ### Properties ||\n|---------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| [deliveryVehicleId](#AuthTokenContext.deliveryVehicleId)` `optional | **Type:** `string `optional When provided, the minted token should have a private `DeliveryVehicleId` claim for the provided deliveryVehicleId. |\n| [taskId](#AuthTokenContext.taskId)` `optional | **Type:** `string `optional When provided, the minted token should have a private `TaskId` claim for the provided taskId. |\n| [trackingId](#AuthTokenContext.trackingId)` `optional | **Type:** `string `optional When provided, the minted token should have a private `TrackingId` claim for the provided trackingId. |\n| [tripId](#AuthTokenContext.tripId)` `optional | **Type:** `string `optional When provided, the minted token should have a private `TripId` claim for the provided tripId. |\n| [vehicleId](#AuthTokenContext.vehicleId)` `optional | **Type:** `string `optional When provided, the minted token should have a private `VehicleId` claim for the provided vehicleId. |\n\n[AuthTokenFetcher](#AuthTokenFetcher)\ntypedef\n---------------------------------------------\n\n\ngoogle.maps.journeySharing`.`AuthTokenFetcher\ntypedef\n\nAuth token function type. \n\nA function that accepts a [AuthTokenFetcherOptions](/maps/documentation/javascript/reference/journey-sharing-authentication#AuthTokenFetcherOptions) object, containing details about the auth token to be minted. This function should mint the token and return a [AuthToken](/maps/documentation/javascript/reference/journey-sharing-authentication#AuthToken) containing the token and its expiry time.\n\n`function(`[AuthTokenFetcherOptions](/maps/documentation/javascript/reference/journey-sharing-authentication#AuthTokenFetcherOptions)`): `[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)`\u003c`[AuthToken](/maps/documentation/javascript/reference/journey-sharing-authentication#AuthToken)`\u003e` \n\n[AuthTokenFetcherOptions](#AuthTokenFetcherOptions)\ninterface\n-------------------------------------------------------------\n\n\ngoogle.maps.journeySharing`.`AuthTokenFetcherOptions\ninterface\n\nOptions for the auth token fetcher.\n\n| ### Properties ||\n|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [context](#AuthTokenFetcherOptions.context) | **Type:** [AuthTokenContext](/maps/documentation/javascript/reference/journey-sharing-authentication#AuthTokenContext) The auth token context. IDs specified in the context should be added to the request sent to the JSON Web Token minting endpoint. |\n| [serviceType](#AuthTokenFetcherOptions.serviceType) | **Type:** [FleetEngineServiceType](/maps/documentation/javascript/reference/journey-sharing-authentication#FleetEngineServiceType) The Fleet Engine service type. |\n\n[FleetEngineServiceType](#FleetEngineServiceType)\nconstants\n-----------------------------------------------------------\n\n\ngoogle.maps.journeySharing`.`FleetEngineServiceType\nconstants\n\nTypes of Fleet Engine services.\n\nAccess by calling `const {FleetEngineServiceType} = await google.maps.importLibrary(\"journeySharing\")`. \nSee [Libraries in the Maps JavaScript API](/maps/documentation/javascript/libraries).\n\n| ### Constants ||\n|------------------------------------------------------------------------------|--------------------------------------------------------|\n| [DELIVERY_VEHICLE_SERVICE](#FleetEngineServiceType.DELIVERY_VEHICLE_SERVICE) | Fleet Engine service used to access delivery vehicles. |\n| [TASK_SERVICE](#FleetEngineServiceType.TASK_SERVICE) | Fleet Engine service used to access task information. |\n| [TRIP_SERVICE](#FleetEngineServiceType.TRIP_SERVICE) | Fleet Engine service used to access trip information. |\n| [UNKNOWN_SERVICE](#FleetEngineServiceType.UNKNOWN_SERVICE) | Unknown Fleet Engine service. |"]]