-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Hi! I'm having trouble getting the example to work. The returned token from the appID login don't seem to persist in the session or in a cookie, so I can't ever access the "protected" endpoint. Am I missing something?
Reproduction steps
- install required packages
npm install --save ibmcloud-appid log4js passport express-session express pug - get sample folder from this repo
- save provided example as server.js
- replace this in server.js with data from existing appid instance
passport.use(new WebAppStrategy({
tenantId: "{tenant-id}",
clientId: "{client-id}",
secret: "{secret}",
oauthServerUrl: "{oauth-server-url}",
redirectUri: "{app-url}" + CALLBACK_URL
}));
- register callback uri with appid (for me
http://localhost:3000/ibm/bluemix/appid/callback) - run node server.js
- navigate to http://localhost:3000/web-app-sample.html
- click "open protected page"
- login
- navigate to http://localhost:3000/web-app-sample.html
- click "open protected page"
Expected
- http://localhost:3000/web-app-sample.html should not show "You're not authenticated :(" after logging in in step 10
- after login I should be able to access /protected
Additional
- Tested on node 18.1.0 and 17.6.0
- Reproduction done in this repo: https://github.com/stepoibm/appid-passport. Clone and create your .env and you should get the same issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels