Skip to content
Ona Docs

GetAuthenticatedIdentity

identity.get_authenticated_identity(IdentityGetAuthenticatedIdentityParams**kwargs) -> IdentityGetAuthenticatedIdentityResponse
POST/gitpod.v1.IdentityService/GetAuthenticatedIdentity

Retrieves information about the currently authenticated identity.

Use this method to:

  • Get current user information
  • Check authentication status
  • Retrieve organization context
  • Validate authentication principal

Examples

  • Get current identity:

    Retrieves details about the authenticated user.

    {}
ParametersExpand Collapse
empty: Optional[bool]
ReturnsExpand Collapse
class IdentityGetAuthenticatedIdentityResponse:
organization_id: Optional[str]
organization_tier: Optional[str]
subject: Optional[Subject]

subject is the identity of the current user

id: Optional[str]

id is the UUID of the subject

formatuuid
principal: Optional[Principal]

Principal is the principal of the subject

One of the following:
"PRINCIPAL_UNSPECIFIED"
"PRINCIPAL_ACCOUNT"
"PRINCIPAL_USER"
"PRINCIPAL_RUNNER"
"PRINCIPAL_ENVIRONMENT"
"PRINCIPAL_SERVICE_ACCOUNT"
"PRINCIPAL_RUNNER_MANAGER"

GetAuthenticatedIdentity

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_authenticated_identity()
print(response.organization_id)
{
  "organizationId": "organizationId",
  "organizationTier": "organizationTier",
  "subject": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "principal": "PRINCIPAL_UNSPECIFIED"
  }
}
Returns Examples
{
  "organizationId": "organizationId",
  "organizationTier": "organizationTier",
  "subject": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "principal": "PRINCIPAL_UNSPECIFIED"
  }
}