Skip to Content
0

Identity Management 8.0: Rest API v72alpha -> Role assignment with Context?

Nov 16, 2016 at 11:18 AM

275

avatar image
Former Member

Dear community,

we are currently implementing a custom UI for the Identity Management based on the RestAPI v72alpha and are stuck with assigning roles (MX_ROLE) to an identity. While we are able to assign roles with a validity and reason, the API fails to assign the roles with a context.

The current code looks like this:

$.ajax({
type: "POST",  
url: "/idmrest/v72alpha/entries/9351/tasks/1323,  
data: {  "MXREF_MX_ROLE": "[{'REASON' : 'test reason', VALIDFROM : '2016-07-11', VALIDTO: '2016-12-28', 'VALUE':'44', CONTEXTID : '223'}] "},
contentType: "application/x-www-form-urlencoded",
dataType: "json",  
success: function(oResponse) { fnResolve();  },  
error: fnReject
});

Inputs:

  • 9351 is the MSKEY of the identity
  • 1323 is a task with MXREF_MX_ROLE
  • 44 is the MSKEY of the role. The role is enabled for the context-type of the context 223 (tested in the default UI)
  • 223 is the context ID

Does anyone have a suggestion/idea/example of this working? Maybe use a different task, as this task does not allow context based assignment within the standard UI. For this we use a guided task, which I'm not sure on how to address it with the Rest API.


Thanks for any help in advance,

Hendrik

10 |10000 characters needed characters left characters exceeded
Former Member

Hi Hendrik,

Not sure you resolved this issue already but please check that you have enabled the Context option in Ext. properties of MXREF_MX_ROLE for Entry Type MX_ROLE.

Let me know how you go.

Thank you,

KV

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Jan 25, 2017 at 09:29 AM
0

Hey Kautilya,

the context-based assignments are working and configured in a correct way.

As it turned out, the SAP documentation has a syntax error. With some extensive trial and error, we found this to be a working solution:

{
“REFERENCED_ID”:54321,
“CONTEXT”:{
“CONTEXT_ID”:12345
},
Share
10 |10000 characters needed characters left characters exceeded