GetAuthenticatedIdentity
client.identity.getAuthenticatedIdentity(IdentityGetAuthenticatedIdentityParams { empty } body, RequestOptionsoptions?): IdentityGetAuthenticatedIdentityResponse { organizationId, organizationTier, subject }
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.
{}
GetAuthenticatedIdentity
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const response = await client.identity.getAuthenticatedIdentity();
console.log(response.organizationId);{
"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"
}
}