AuthTokenContext
Stay organized with collections
Save and categorize content based on your preferences.
The AuthTokenContext class encapsulates the state needed to generate an auth token for a
given request and is provided when AuthTokenFactory#getToken is called.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Constructors
public AuthTokenContext ()
Public Methods
Returns new default Builder instance.
public abstract String getTaskId ()
Returns the optional task id for the call if it is a required auth token claim.
public abstract String getVehicleId ()
Returns the optional vehicle id for the call if it is a required auth token
claim.
Returns new Builder instance set with current AuthTokenContext state.
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-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eAuthTokenContext\u003c/code\u003e stores the necessary information for generating authentication tokens for requests.\u003c/p\u003e\n"],["\u003cp\u003eIt includes optional task and vehicle IDs that might be required for token claims.\u003c/p\u003e\n"],["\u003cp\u003eYou can create an \u003ccode\u003eAuthTokenContext\u003c/code\u003e using a builder pattern.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAuthTokenContext.AuthTokenFactory\u003c/code\u003e interface provides the authorization token.\u003c/p\u003e\n"]]],[],null,["# AuthTokenContext\n\npublic abstract class **AuthTokenContext** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nThe AuthTokenContext class encapsulates the state needed to generate an auth token for a\ngiven request and is provided when AuthTokenFactory#getToken is called. \n\n### Nested Class Summary\n\n|-----------|---|---|--------------------------------------------------------------------------------------------------------------------|\n| interface | [AuthTokenContext.AuthTokenFactory](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext.AuthTokenFactory) || Instances of this interface will be asked to provide an authorization token when various operations are performed. |\n| class | [AuthTokenContext.Builder](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext.Builder) || Builder for AuthTokenContext. |\n\n### Public Constructor Summary\n\n|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [AuthTokenContext](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext#AuthTokenContext())() |\n\n### Public Method Summary\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [AuthTokenContext.Builder](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext.Builder) | [builder](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext#builder())() Returns new default Builder instance. |\n| abstract [String](//developer.android.com/reference/java/lang/String.html) | [getTaskId](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext#getTaskId())() Returns the optional task id for the call if it is a required auth token claim. |\n| abstract [String](//developer.android.com/reference/java/lang/String.html) | [getVehicleId](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext#getVehicleId())() Returns the optional vehicle id for the call if it is a required auth token claim. |\n| abstract [AuthTokenContext.Builder](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext.Builder) | [toBuilder](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext#toBuilder())() Returns new Builder instance set with current AuthTokenContext state. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **AuthTokenContext** ()\n\nPublic Methods\n--------------\n\n#### public static [AuthTokenContext.Builder](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext.Builder) **builder**\n()\n\nReturns new default Builder instance. \n\n#### public abstract [String](//developer.android.com/reference/java/lang/String.html) **getTaskId** ()\n\nReturns the optional task id for the call if it is a required auth token claim. \n\n#### public abstract [String](//developer.android.com/reference/java/lang/String.html) **getVehicleId** ()\n\nReturns the optional vehicle id for the call if it is a required auth token\nclaim. \n\n#### public abstract [AuthTokenContext.Builder](/maps/documentation/mobility/driver-sdk/scheduled/reference/driver_6/android/reference/com/google/android/libraries/mapsplatform/transportation/driver/api/base/data/AuthTokenContext.Builder) **toBuilder**\n()\n\nReturns new Builder instance set with current AuthTokenContext state."]]