## GetAuthenticatedIdentity `client.Identity.GetAuthenticatedIdentity(ctx, body) (*IdentityGetAuthenticatedIdentityResponse, error)` **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. ```yaml {} ``` ### Parameters - `body IdentityGetAuthenticatedIdentityParams` - `Empty param.Field[bool]` ### Returns - `type IdentityGetAuthenticatedIdentityResponse struct{…}` - `OrganizationID string` - `OrganizationTier string` - `Subject Subject` subject is the identity of the current user - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Identity.GetAuthenticatedIdentity(context.TODO(), gitpod.IdentityGetAuthenticatedIdentityParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.OrganizationID) } ``` #### Response ```json { "organizationId": "organizationId", "organizationTier": "organizationTier", "subject": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" } } ```