Is there a way, when logged in in app mode, to add a user to app? I tried the following and got an error:
var roleAssignment= new AppRoleAssignment() {
Id = Guid.Empty,
ObjectId = user.ObjectId,
ResourceId = Guid.Parse(AppModeConstants.ServicePrincipalObjectId),
PrincipalId = Guid.Parse(user.ObjectId),
PrincipalType = "User"
};
user.AppRoleAssignments.Add(roleAssignment);
await user.UpdateAsync();
Error:
{"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"One or more properties are invalid."},"date":"2017-12-19T18:57:45","requestId":"b2e61bc7-bbe1-4a7f-9f9d-3ce405b418a1","values":null}}
Is there a way, when logged in in app mode, to add a user to app? I tried the following and got an error:
Error:
{"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"One or more properties are invalid."},"date":"2017-12-19T18:57:45","requestId":"b2e61bc7-bbe1-4a7f-9f9d-3ce405b418a1","values":null}}