GoogleRidesharingDriver Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMTDAuthorization
@protocol GMTDAuthorization <NSObject>
Protocol used to provide authorization tokens for gRPC calls. These tokens
give access to the Fleet Engine service accounts.
The implementation should ensure that a valid authorization token is always available.
The authorization token should have a minimum lifetime of 5 minutes to allow for requests to
complete. Therefore, the authorization token must automatically renew expiring tokens and
minimize the number of token refreshes by re-using a token until its lifetime nears its end.
Implementations of this protocol must be thread-safe.
-
Called by the SDK to fetch a JWT. The implementation must assume that this method
may be invoked from arbitrary queues.
Parameters
authorizationContext
|
The context of the target authorization token.
|
completion
|
Must be called asynchronously, but can be called from any queue.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-21 UTC."],[[["\u003cp\u003eGMTDAuthorization is a protocol designed to provide authorization tokens for gRPC calls, enabling access to Fleet Engine service accounts.\u003c/p\u003e\n"],["\u003cp\u003eThe protocol mandates that a valid authorization token is consistently available, with a minimum lifetime of 5 minutes to facilitate request completion.\u003c/p\u003e\n"],["\u003cp\u003eToken implementations must renew expiring tokens automatically and minimize refreshes by reusing them until near expiration.\u003c/p\u003e\n"],["\u003cp\u003eImplementations of this protocol are required to be thread-safe, ensuring proper concurrent handling.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003efetchTokenWithContext:completion:\u003c/code\u003e method, which can be invoked from arbitrary queues, is used by the SDK to retrieve a JWT and must call the provided completion block asynchronously.\u003c/p\u003e\n"]]],[],null,["GMTDAuthorization \n\n @protocol GMTDAuthorization \u003cNSObject\u003e\n\nProtocol used to provide authorization tokens for gRPC calls. These tokens\ngive access to the Fleet Engine service accounts.\n\nThe implementation should ensure that a valid authorization token is always available.\nThe authorization token should have a minimum lifetime of 5 minutes to allow for requests to\ncomplete. Therefore, the authorization token must automatically renew expiring tokens and\nminimize the number of token refreshes by re-using a token until its lifetime nears its end.\n\nImplementations of this protocol must be thread-safe.\n- `\n ``\n ``\n `\n\n [-fetchTokenWithContext:completion:](#/c:objc(pl)GMTDAuthorization(im)fetchTokenWithContext:completion:)`\n ` \n Called by the SDK to fetch a JWT. The implementation must assume that this method\n may be invoked from arbitrary queues. \n\n Declaration \n Swift \n\n func fetchToken(with authorizationContext: ../Classes/GMTDAuthorizationContext.html?) async throws -\u003e String\n\n Objective-C \n\n - (void)fetchTokenWithContext:\n (nullable ../Classes/GMTDAuthorizationContext.html *)authorizationContext\n completion:\n (nonnull ../Type-Definitions/GMTDAuthTokenFetchCompletionHandler.html)completion;\n\n Parameters\n\n |------------------------------|------------------------------------------------------------------|\n | ` `*authorizationContext*` ` | The context of the target authorization token. |\n | ` `*completion*` ` | Must be called asynchronously, but can be called from any queue. |"]]