## GetIDToken `identity.get_id_token(IdentityGetIDTokenParams**kwargs) -> IdentityGetIDTokenResponse` **post** `/gitpod.v1.IdentityService/GetIDToken` Gets an ID token for authenticating with other services. Use this method to: - Obtain authentication tokens for service-to-service calls - Access protected resources - Generate scoped access tokens ### Examples - Get token for single service: Retrieves a token for authenticating with one service. ```yaml audience: - "https://api.gitpod.io" ``` - Get token for multiple services: Retrieves a token valid for multiple services. ```yaml audience: - "https://api.gitpod.io" - "https://ws.gitpod.io" ``` ### Parameters - `audience: Optional[Sequence[str]]` - `version: Optional[IDTokenVersion]` version is the version of the ID token. - `"ID_TOKEN_VERSION_UNSPECIFIED"` - `"ID_TOKEN_VERSION_V1"` - `"ID_TOKEN_VERSION_V2"` ### Returns - `class IdentityGetIDTokenResponse: …` - `token: Optional[str]` ### Example ```python import os from gitpod import Gitpod client = Gitpod( bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted ) response = client.identity.get_id_token( audience=["https://api.gitpod.io", "https://ws.gitpod.io"], ) print(response.token) ``` #### Response ```json { "token": "token" } ```