0

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

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:

  • Failed to load [appid-auth-url] No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

appid-auth-url is provided by IBM, can't be set cors.

Wind
  • 1
  • 1
  • Possible duplicate of [No 'Access-Control-Allow-Origin' is present, Origin 'null' not allowed access - Passport-SteamStrategy, Node](https://stackoverflow.com/questions/42845193/no-access-control-allow-origin-is-present-origin-null-not-allowed-access) – eol May 11 '18 at 08:53
  • You need to allow CORS in your server. Please see https://stackoverflow.com/questions/18310394/no-access-control-allow-origin-node-apache-port-issue – Asaf Manassen May 11 '18 at 21:46

1 Answers1

0

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.

You can also watch the App ID tutorial for protecting node.js applications - https://youtu.be/6roa1ZOvwtw

Anton
  • 3,166
  • 1
  • 13
  • 12