如何解决Microsoft Graph - tslib.js:113 Uncaught (in promise) TypeError: _this.provider is not a function
我得到了下面的代码来在 microsoft Graph 中创建一个用户:
const msalConfig = {
auth: {
clientId: "Ive substituted this for my clientId",redirectUri: "Ive substituted this for my URL",},};
const graphScopes = ["user.read","mail.send"];
const msalApplication = new UserAgentApplication(msalConfig);
const options = new MSALAuthenticationProviderOptions(graphScopes);
const authProvider = new ImplicitMSALAuthenticationProvider(msalApplication,options);
const options2 = {
authProvider,};
const client = Client.init(options2);
const user = {
accountEnabled: true,displayName: "Adele Vance",mailNickname: "AdeleV",userPrincipalName: "AdeleV@contoso.onmicrosoft.com","passwordProfile" : {
forceChangePasswordNextSignIn: true,password: "xWwvJ]6NMw+bWH-d"
}
};
let res = client.api('/users')
.post(user);
})
但我收到以下错误:tslib.js:113 Uncaught (in promise) TypeError: _this.provider is not a function
有人可以帮我吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。