如何解决如何运行MSAL样本?
我正在努力了解运行msal样品的正确过程。
这是我尝试过的。...
- 使用
microsoft-authentication-library-for-js
克隆主git clone https://github.com/AzureAD/microsoft-authentication-library-for-js.git
存储库 - 根据说明here,我尝试了以下操作...
// Change to the root of the msal repo
cd microsoft-authentication-library-for-js/
// Install npm dependencies and bootstrap packages
npm install
// Build library
npm run build
这将返回以下错误...
@azure/msal-browser: [!] (plugin rpt2) Error: E:/Important Documents/Programming/microsoft-authentication-library-for-js/lib/msal-browser/src/index.ts(34,8): semantic error TS2307: Cannot find module '@azure/msal-common'.
@azure/msal-browser: src\index.ts
@azure/msal-browser: Error: E:/Important Documents/Programming/microsoft-authentication-library-for-js/lib/msal-browser/src/index.ts(34,8): semantic error TS2307: Cannot find module '@azure/msal-common'.
- 然后我尝试了其他说明...
// Change to the msal-browser package directory
cd lib/msal-browser/
// Ensure you are using the local build of msal-common
npm link @azure/msal-common
// To run build for common and browser package
npm run build:all
这将返回以下错误
src/index.ts → ./dist/index.js,./dist/index.es.js,./lib/msal-browser.js...
[!] (plugin rpt2) Error: E:/Important Documents/Programming/microsoft-authentication-library-for-js/lib/msal-browser/src/app/ClientApplication.ts(8,534): semantic error TS2305: Module '"../../../../../../../Important Documents/Programming/microsoft-authentication-library-for-js/lib/msal-browser/node_modules/@azure/msal-common/dist/src"' has no exported member 'ThrottlingUtils'.
src\app\ClientApplication.ts
Error: E:/Important Documents/Programming/microsoft-authentication-library-for-js/lib/msal-browser/src/app/ClientApplication.ts(8,534): semantic error TS2305: Module '"../../../../../../../Important Documents/Programming/microsoft-authentication-library-for-js/lib/msal-browser/node_modules/@azure/msal-common/dist/src"' has no exported member 'ThrottlingUtils'.
- 然后我更新了
./app/<sample-name>/authConfig.js
文件夹中的VanillaJSTestApp2.0
文件以匹配我在Azure门户中的设置 - 然后我用
VanillaJSTestApp2.0
进入cd samples/msal-browser-samples/VanillaJSTestApp2.0
文件夹 - 我跑了
npm install
- 我跑了
npm start
并导航到http://localhost:30662/
虽然我可以看到带有引导程序控件的网站,但是当我单击任一Sign In
控件时,什么也没有发生。
最初浏览该网站时记录以下错误
Uncaught ReferenceError: msal is not defined
at auth.js:16
单击任一Sign In
选项时会记录以下错误
auth.js:44 Uncaught (in promise) ReferenceError: Cannot access 'myMSALObj' before initialization
at signIn (auth.js:44)
at HTMLButtonElement.onclick ((index):22)
我在做什么错了?
我在Windows上使用VSCode。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。