Get User Self

Last modified 13 Mar 2024 13:32 +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

In our examples we are authenticating with the credentials, name "administrator" and password "y0uR_P455woR*d" on a localhost instance running on port 8080.

For some help regarding the REST examples please see this link:

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