Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Add user to app? #53

Open
ivoloshin opened this issue Dec 19, 2017 · 0 comments
Open

Add user to app? #53

ivoloshin opened this issue Dec 19, 2017 · 0 comments
Labels

Comments

@ivoloshin
Copy link

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}}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants