![](/img/trans.png)
[英]How to properly import and use the MSAL (Microsoft Authentication Library for js) into a typescript react single page application?
[英]How to properly import and use the MSAL (Microsoft Authentication Library for js) into a javascript (non typescript) react single page application?
我试图将Msal导入reactjs应用程序。 由于该应用程序是由create-react-app创建的,因此项目本身中没有webpack加载器。 我无法参考Msal。 尝试过:
var Msal = require('msal/out/msal.js');
var Msal = require('msal');
import Msal from 'msal';
import {Msal} from 'msal';
总是有一个空的Msal,而没有用于创建连接器的构造函数。
var userAgentApplication = new **Msal**.UserAgentApplication("your_client_id", null, function (errorDes, token, error, tokenType) {
// this callback is called after loginRedirect OR acquireTokenRedirect (not used for loginPopup/aquireTokenPopup)
})
可以导入msal 0.1.3
请参阅https://github.com/sunilbandla/vue-msal-sample
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.