Skip to Content
0
Apr 02, 2015 at 08:26 AM

SF Odata to retrieve current logged in user in browser

681 Views

Dear Experts,

We are trying to retrieve current logged in user in Successfactors instance from Odata call.

We are able to get the user details by odata call and passing the username ( admin) as below -

var service_url= "https:// . successfactors.com/odata/v2/User(%27admin%27)/?$format=json";

oModel.loadData(service_url,null,false, "GET", false, false, null);

var username = oModel.getData().d.username;

But we would like to read the logged in user and use in the code above . So that we can get user details for every logged in user and not a particular user ex - admin.

Any inputs are greatly appreciated .

Thanks,
Sahiba Gandhi