Get User Self

Last modified 05 Feb 2024 11:58 +01:00
Table of Contents

Description

Example of retrieving identity data from a web resource object representing a user. In this specific sample you will retrieve the profile information of the user executing the command.

For the purpose of the sample we are using the CURL tool as it is a well maintained, well tested, and it’s widely accessible.

Authentication methods used to work with the REST api

Authentication methods

Example

Get Own profile information
# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -X GET http://localhost:8080/midpoint/ws/rest/self
Get Own profile information in JSON format
# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/self
Get Own profile information in JSON format with the Raw option set to true
# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/self?options=raw
Was this page helpful?
YES NO
Thanks for your feedback