我正在使用此代码从Java SDK在Azure Active Directory中创建用户.我已经安装了所有必需的包和库.
User user = new User();
user.accountEnabled = true;
user.displayName = "Kevin";
user.mailNickname = "kevin";
user.userPrincipalName = "kevin234@domain.onmicrosoft.com";
PasswordProfile passwordProfile = new PasswordProfile();
passwordProfile.forceChangePasswordNextSignIn = true;
passwordProfile.password = "***********";
user.passwordProfile = passwordProfile;
graphClient.users()
.buildRequest()
.post(user);
我可以创建普通用户,但如何创建来宾用户.我在上面的代码中包含了user.userType='guest'
user.userPrincipalName = "kevin234@hotmail.com";
user.userType='guest'; // I added this that outputs Invalid Request error
graphClient.users()
.buildRequest()
.post(user);
使用Graph API Query有什么简单的方法可以做到这一点吗?有人能建议我在代码中进行哪些更改才能实现我的场景吗?
提亚