io.enterpriseai.resources.IdentityClient
Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/IdentityClient.java. Back to the Java SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class IdentityClient
Identity of the calling principal.
Constructor IdentityClient
IdentityClient(Transport transport)
Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
transport | Transport | yes | Transport shared by the sub-clients of one client. |
IdentityClient.changePassword
JsonNode changePassword(Object body)
Change the password. Changes the password of the signed in local account. Only for a portal session (403 password_session_required).
Route: /v1/auth/password (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | Current and new password. |
Returns: JsonNode. Decoded JSON answer of the operation "Change the password".
Raises: the typed errors of the transport (Errors).
IdentityClient.login
JsonNode login(Object body)
Sign in with a login and a password. Opens a portal session for a local account. No credential is needed. The login is compared without case.
Route: /v1/auth/login (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
body | Object | yes | Login and password of the local account. |
Returns: JsonNode. Decoded JSON answer of the operation "Sign in with a login and a password".
Raises: the typed errors of the transport (Errors).
IdentityClient.logout
JsonNode logout()
Sign out. Revokes the current portal session: its token is refused from now on (401 session_revoked). Only for a portal session (403 password_session_required with another credential). Writes the audit event auth.logout. Answers 204.
Route: /v1/auth/logout (POST).
This element takes no parameter.
Returns: JsonNode. Decoded JSON answer of the operation "Sign out".
Raises: the typed errors of the transport (Errors).
IdentityClient.whoami
JsonNode whoami()
Show the calling identity. Returns the identity the platform resolved for this request, whatever the credential (OIDC token, portal session, API key, SPIFFE): id, kind (user, service, agent, system), tenant_id, tenant_slug, roles, scopes, clearance, auth_method and display. Read only, open to any authenticated caller, also while a local account must still change its password. Use it to check a new token or key.
Route: /v1/identity/whoami (GET).
This element takes no parameter.
Returns: JsonNode. Decoded JSON answer of the operation "Show the calling identity".
Raises: the typed errors of the transport (Errors).