7 My Profile
As a mobile app developer, you use the My Profile API to access details about the currently authorized user.
Note:
This API only retrieves user information. To add or update users programmatically, see REST API for Oracle Identity Cloud Service.User Types
The information that the API returns depends on what type of user you are inquiring about. Here are the types of users:
-
IDCS users: These users have accounts that are managed by the domain’s Oracle Identity Cloud Service (IDCS) as described in Mobile Users and Roles.
-
Virtual users: These users pass a third-party token for authorization as described in Enterprise Single Sign-On in OMCe.
-
Social users: These users have logged into the app from Facebook, as described in Facebook Login in OMCe.
Getting User Profile Information
If your app needs user information, such as full names and roles, you can call the User Profile API to get that information from their profile.
You have two options for getting a user’s profile:
-
You can make a direct REST call as described in this topic and detailed in Oracle Mobile Cloud Enterprise REST API Reference.
-
You can call the ums.getMe(httpOptions) method from a custom API implementation.
To get the currently authorized user’s profile via a direct REST call, send a GET
request to /mobile/platform/users/me
. Here’s an example of using cURL to send the request:
curl -i \
-X GET \
-u joe.doe@example.com:mypass \
-H "Oracle-Mobile-Backend-ID: ABCD9278-091f-41aa-9cb2-184bd0586fce" \
https://fif.cloud.oracle.com/mobile/platform/users/me
-
When the user is an IDCS user, the response contains the IDCS user information, including roles.
-
When the user is a virtual user, the response contains the user name and roles.
-
When the user is a social user, the response contains the user's mobile ID.
Here’s an example of a response for an IDCS user:
{
"idcsCreatedBy":{
"type":"User",
"display":"admin opc",
"value":"ABCD6996a13b1641eca66fbf4c75af42",
"$ref":"https://my.idcs.com:443/admin/v1/Apps/ABCD6996a13b1641eca66fbf4c75af42"},
"id":"ABCD5f2a5eb5e1664cbc94fc651a8562",
"active":true,
"displayName":"Doe Joe",
"idcsLastModifiedBy":{
"value":"ABCD5316fb6146d1bb3b60b75363",
"display":"idcssso",
"type":"App",
"$ref":"https://my.idcs.com:443/admin/v1/Apps/ABCD5316fb6146d1bb3b60b75363"},
"userName":"jdoe",
"urn:ietf:params:scim:schemas:oracle:idcs:extension:user:User":{
"isFederatedUser":false,
"grants":[
{
"appId":"c6a3a4174e8a4975b688f43e8aaace18",
"grantMechanism":"ADMINISTRATOR_TO_USER",
"value":"273979318ee2482bba40a44142a6c90a",
"$ref":"https://my.idcs.com:443/admin/v1/Grants/273979318ee2482bba40a44142a6c90a"}
],
"appRoles":[
{
"value":"ABCD278fbf50244c0ab13f16a117b7da7",
"adminRole":false,
"legacyGroupName":"ABCD29F71D52E41B49EBD6F895FDA.ServiceBusinessUser",
"appId":"ABCD220aeebc14937b4b82df71671",
"appName":"ABCD2F71D52E41B49EBD6F895FDA_APPID",
"display":"MyMobileAppUser",
"$ref":"https://my.idcs.com:443/admin/v1/AppRoles/ABCD278fbf50244c0ab13f16a117b"}
],
"accounts":[
{
"value":"125daaab1e7e47b995232f51516544c6",
"appId":"c6a3a4174e8a4975b688f43e8aaace18",
"$ref":"https://my.idcs.com:443/admin/v1/AccountMgmtInfos/125daaab1e7e47b995232f51516544c6"}
]},
"emails":[
{
"type":"recovery",
"primary":false,
"value":"jdoe@example.com",
"verified":false},
{
"type":"work",
"primary":true,
"value":"jdoe@example.com",
"verified":false}
],
"name":{
"givenName":"Joe",
"familyName":"Doe",
"formatted":"Joe Doe"},
"schemas":["urn:ietf:params:scim:schemas:core:2.0:User"
]}
Here’s an example of a response for a virtual user:
{
"userName":"jdoe",
"urn:ietf:params:scim:schemas:oracle:idcs:extension:user:User":{
"appRoles":[
{
"display":"FIF_TECHNICIAN"}
]
}
}
Here’s an example of a response for a social (Facebook) user:
{
"userName": "1 :623:165"
}