Retrieve detailed information about the currently authenticated user based on their JWT token.
Authentication: Uses the JWT token to automatically identify the user by their CPF
from the preferred_username field in the Keycloak token.
Auto-Retrieval: No need to specify the CPF - it’s automatically extracted from the JWT token.
Auto-Creation: If the user doesn’t exist in the system, they are automatically created during the authentication process.
Role Aggregation: The response includes both direct roles assigned to the user and roles inherited through group memberships.
Use Cases:
Security: Only returns information about the authenticated user - no access to other users’ data.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Current user information retrieved successfully
Response model for user information.
Unique identifier for the user
1
User's CPF (Cadastro de Pessoa Física) - Brazilian tax ID
"12345678901"
User's display name from JWT token (name, given_name, or email)
"João Silva"
List of groups the user belongs to
[
"engineering_team:backend",
"data_analysts:read"
]List of roles assigned to the user (both direct and through groups)
["superadmin", "data-analyst"]