I have been following this Hyperledger Composer tutorial here and when I try to authenticate to the rest server via http://localhost:3000/auth/github I am not being redirected to the GitHub site to perform the OAuth web server authentication flow. Instead of redirecting, I am getting a 404 error message. Expected Behavior
According to the Composer tutorial, I would expect being redirected to the Github site to perform the OAuth. Actual Behavior
When I enter http://localhost:3000/auth/github I am getting a 404 error
My environment:
docker --version Docker version 17.03.1-ce, build c6d412e
docker-compose --version docker-compose version 1.13.0, build 1719ceb
node --version v6.11.0
Adding more details for reference...
[
EDIT:
here is complete error stack trace:
Unhandled error for request GET /explorer/auth/github: Error: Cannot GET /explorer/auth/github at raiseUrlNotFoundError (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/loopback/server/middleware/url-not-found.js:21:17) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15 at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:260:14) at Function.handle (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:174:3) at router (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at Immediate.next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at Immediate. (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15) Unhandled error for request GET /explorer/auth/github: Error: Cannot GET /explorer/auth/github at raiseUrlNotFoundError (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/loopback/server/middleware/url-not-found.js:21:17) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15 at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:260:14) at Function.handle (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:174:3) at router (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at Immediate.next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at Immediate. (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15) Unhandled error for request GET /explorer/auth/github: Error: Cannot GET /explorer/auth/github at raiseUrlNotFoundError (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/loopback/server/middleware/url-not-found.js:21:17) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15 at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:260:14) at Function.handle (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:174:3) at router (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at Immediate.next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at Immediate. (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15) Unhandled error for request GET /explorer/auth/github: Error: Cannot GET /explorer/auth/github at raiseUrlNotFoundError (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/loopback/server/middleware/url-not-found.js:21:17) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15 at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:260:14) at Function.handle (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:174:3) at router (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at Immediate.next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at Immediate. (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15) Unhandled error for request GET /explorer/auth/github: Error: Cannot GET /explorer/auth/github at raiseUrlNotFoundError (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/loopback/server/middleware/url-not-found.js:21:17) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15 at next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:260:14) at Function.handle (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:174:3) at router (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:317:13) at /home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:335:12) at Immediate.next (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:275:10) at Immediate. (/home/brankoterzic/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/express/lib/router/index.js:635:15)
Check if your github account is private. I created a new github account, and it works. Also use the latest command:
instead of the -S one
Good luck!
in your COMPOSER_PROVIDERS stanza - specifically the callbackURL setting - you don't need the localhost:3000 - you just need the URL path as "/auth/github/callback" shown in the docs : https://hyperledger.github.io/composer/integrating/enabling-rest-authentication.html . The REST server will take care of..the rest.. . Then stop and restart the composer REST server
composer-rest-server -p hlfv1 -n my-network -i admin -s adminpw -S true
etc - from the command line where you export the configuration variable COMPOSER_PROVIDERS (above). cheers Paul