[英]"Authentication Client ID is not configured", I am making a react SPA of a microsoft login page for my application using azure. What is my mistake?
This is what I have done:这就是我所做的:
I added a .env
file on the root Level:我在根级别添加了一个
.env
文件:
REACT_APP_AZURE_ACTIVE_DIRECTORY_APP_CLIENT_ID = (Client ID)
Then I added three files under src
subfolder.然后我在
src
子文件夹下添加了三个文件。
Then I changed the code of app.tsx
to a new one as I was asked.然后我按照要求将
app.tsx
的代码更改为新代码。
This is the tutorial I am following . 这是我正在关注的教程。
https://learn.microsoft.com/en-us/azure/developer/javascript/tutorial/single-page-application-azure-login-button-sdk-msal https://learn.microsoft.com/en-us/azure/developer/javascript/tutorial/single-page-application-azure-login-button-sdk-msal
I don't change anythings in project.我不会更改项目中的任何内容。 Just paste client_id into
.env
file.只需将 client_id 粘贴到
.env
文件中。
And I also follow the offical doc, create app regidtration, add spa and so on.而且我还按照官方文档,创建应用程序注册,添加水疗等。
My test steps:我的测试步骤:
Download sample peoject code from the link you provided.从您提供的链接下载示例项目代码。
Open it by vscode, run cmd npm i
.用 vscode 打开它,运行 cmd
npm i
。
Copy and paste clientid into .env
file.将 clientid 复制并粘贴到
.env
文件中。
Then excute cmd npm run start
.然后执行 cmd
npm run start
。 It works fine.它工作正常。
I was also following the MS tutorial and encountered the same problem.我也在关注 MS 教程并遇到了同样的问题。 What I needed to do was:
我需要做的是:
npm i
(I don't now if this step is needed)npm i
(我现在不知道是否需要此步骤)npm run start
npm run start
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.