简体   繁体   English

Node.js中的ibm应用程序ID注销

[英]ibm App ID logout in nodejs

I integrate IBM APP ID in my project in local,after login succeed, when I try to log out use the following code as same as demo 我将IBM APP ID集成到本地项目中,登录成功后,当我尝试注销时,请使用与演示相同的以下代码

app.get("/logout", function(req, res, next) {
    WebAppStrategy.logout(req);
    res.redirect("/");
});

nodejs show the request is successfully send but chrome console show the following error message: nodejs显示请求已成功发送,但chrome控制台显示以下错误消息:

  • Failed to load [appid-auth-url] No 'Access-Control-Allow-Origin' header is present on the requested resource. 无法加载[appid-auth-url]请求的资源上不存在“ Access-Control-Allow-Origin”标头。 Origin ' http://localhost:3000 ' is therefore not allowed access. 因此,不允许访问源' http:// localhost:3000 '。

appid-auth-url is provided by IBM, can't be set cors. appid-auth-url由IBM提供,不能设置为cors。

Check out the simple node.js web app that is implementing this functionality for a reference - https://github.com/ibm-cloud-security/appid-video-tutorials/tree/master/02a-simple-node-web-app . 查看实现此功能的简单node.js Web应用程序以供参考-https: //github.com/ibm-cloud-security/appid-video-tutorials/tree/master/02a-simple-node-web-应用程式

You can also watch the App ID tutorial for protecting node.js applications - https://youtu.be/6roa1ZOvwtw 您还可以观看应用程序ID教程保护的Node.js应用- https://youtu.be/6roa1ZOvwtw

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM